From 4c074b86da9a3088caf9dc49f0ac7eb7d7cd92ab Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Oct 2021 03:07:07 +0000 Subject: [PATCH] CodeGen from PR 16431 in Azure/azure-rest-api-specs Merge 55237cfe8ea393799b30c95c029cfee68aa09574 into 62ec79080af0d0d609650d67155ef4a93ae11482 --- .../CHANGELOG.md | 3 +- .../README.md | 4 +- .../SAMPLE.md | 1911 ++++++++++++++++- .../azure-resourcemanager-consumption/pom.xml | 2 +- .../consumption/ConsumptionManager.java | 14 +- .../fluent/ConsumptionManagementClient.java | 7 - .../consumption/fluent/CreditsClient.java | 18 +- .../fluent/EventsOperationsClient.java | 56 +- .../consumption/fluent/ForecastsClient.java | 43 - .../fluent/LotsOperationsClient.java | 55 +- .../consumption/fluent/PriceSheetsClient.java | 10 +- ...eservationRecommendationDetailsClient.java | 17 +- .../fluent/ReservationsSummariesClient.java | 8 +- .../fluent/UsageDetailsClient.java | 8 +- .../fluent/models/BalanceInner.java | 184 +- .../fluent/models/BalanceProperties.java | 273 +++ .../fluent/models/BudgetInner.java | 179 +- .../fluent/models/BudgetProperties.java | 279 +++ .../fluent/models/CreditSummaryInner.java | 136 +- .../models/CreditSummaryProperties.java | 162 ++ .../fluent/models/EventProperties.java | 440 ++++ .../fluent/models/EventSummaryInner.java | 363 ++-- .../fluent/models/ForecastInner.java | 187 -- .../models/LegacyChargeSummaryProperties.java | 130 ++ ...cyReservationRecommendationProperties.java | 257 +++ ...egacyReservationTransactionProperties.java | 336 +++ .../models/LegacyUsageDetailProperties.java | 726 +++++++ .../fluent/models/LotProperties.java | 257 +++ .../fluent/models/LotSummaryInner.java | 226 +- ...nagementGroupAggregatedCostProperties.java | 221 ++ ...agementGroupAggregatedCostResultInner.java | 153 +- .../fluent/models/MarketplaceInner.java | 270 +-- .../fluent/models/MarketplaceProperties.java | 420 ++++ .../models/ModernChargeSummaryProperties.java | 199 ++ ...rnReservationRecommendationProperties.java | 282 +++ .../ModernReservationTransactionInner.java | 185 +- ...odernReservationTransactionProperties.java | 334 +++ .../models/ModernUsageDetailProperties.java | 1193 ++++++++++ .../fluent/models/PriceSheetModel.java | 78 + .../fluent/models/PriceSheetResultInner.java | 87 +- .../fluent/models/ReservationDetailInner.java | 157 +- .../models/ReservationDetailProperties.java | 209 ++ ...vationRecommendationDetailsModelInner.java | 100 +- ...vationRecommendationDetailsProperties.java | 126 ++ .../ReservationRecommendationInner.java | 42 +- .../models/ReservationSummaryInner.java | 194 +- .../models/ReservationSummaryProperties.java | 280 +++ .../models/ReservationTransactionInner.java | 179 +- .../fluent/models/TagProperties.java | 85 + .../fluent/models/TagsResultInner.java | 90 +- .../fluent/models/UsageDetailInner.java | 6 +- .../AggregatedCostsClientImpl.java | 2 +- .../implementation/BalanceImpl.java | 26 +- .../implementation/BalancesClientImpl.java | 4 +- .../implementation/BudgetImpl.java | 18 +- .../ConsumptionManagementClientImpl.java | 16 +- .../implementation/CreditSummaryImpl.java | 34 +- .../implementation/CreditsClientImpl.java | 99 +- .../implementation/CreditsImpl.java | 9 +- .../implementation/EventSummaryImpl.java | 90 +- .../EventsOperationsClientImpl.java | 433 +++- .../implementation/EventsOperationsImpl.java | 23 +- .../implementation/ForecastImpl.java | 88 - .../implementation/ForecastsClientImpl.java | 250 --- .../implementation/ForecastsImpl.java | 46 - .../implementation/LotSummaryImpl.java | 59 +- .../LotsOperationsClientImpl.java | 428 +++- .../implementation/LotsOperationsImpl.java | 22 +- ...nagementGroupAggregatedCostResultImpl.java | 26 +- .../implementation/MarketplaceImpl.java | 26 +- .../implementation/PriceSheetResultImpl.java | 26 +- .../implementation/PriceSheetsClientImpl.java | 30 +- .../implementation/ReservationDetailImpl.java | 26 +- ...vationRecommendationDetailsClientImpl.java | 57 +- .../ReservationRecommendationDetailsImpl.java | 15 +- ...rvationRecommendationDetailsModelImpl.java | 18 +- .../ReservationRecommendationImpl.java | 20 +- .../ReservationSummaryImpl.java | 26 +- .../ReservationsSummariesClientImpl.java | 40 +- .../implementation/TagsResultImpl.java | 8 +- .../UsageDetailsClientImpl.java | 31 +- .../models/AmountWithExchangeRate.java | 14 +- .../consumption/models/Balance.java | 28 +- .../consumption/models/Bound.java | 34 - .../consumption/models/Budget.java | 76 +- .../consumption/models/ChargeSummary.java | 6 +- .../consumption/models/ChargeType.java | 34 - .../models/CreditBalanceSummary.java | 22 +- .../consumption/models/CreditSummary.java | 37 +- .../consumption/models/Credits.java | 18 +- .../consumption/models/CultureCode.java | 91 - .../consumption/models/EventSummary.java | 147 +- .../consumption/models/EventsOperations.java | 54 +- .../consumption/models/Forecast.java | 100 - ...orecastPropertiesConfidenceLevelsItem.java | 81 - .../consumption/models/Forecasts.java | 38 - .../models/ForecastsListResult.java | 44 - .../consumption/models/Grain.java | 37 - .../models/LegacyChargeSummary.java | 78 +- .../LegacyReservationRecommendation.java | 143 +- .../consumption/models/LegacyUsageDetail.java | 403 +--- .../consumption/models/LotSource.java | 3 + .../consumption/models/LotSummary.java | 92 +- .../consumption/models/LotsOperations.java | 52 +- .../ManagementGroupAggregatedCostResult.java | 28 +- .../consumption/models/Marketplace.java | 28 +- .../models/ModernChargeSummary.java | 117 +- .../ModernReservationRecommendation.java | 203 +- .../consumption/models/ModernUsageDetail.java | 658 ++---- .../consumption/models/Notification.java | 26 - .../consumption/models/PriceSheetResult.java | 28 +- .../consumption/models/PriceSheets.java | 10 +- .../consumption/models/PricingModelType.java | 37 + .../consumption/models/Reseller.java | 10 +- .../consumption/models/ReservationDetail.java | 28 +- .../models/ReservationRecommendation.java | 35 +- .../ReservationRecommendationDetails.java | 16 +- ...ReservationRecommendationDetailsModel.java | 16 +- .../ReservationRecommendationsListResult.java | 15 - .../models/ReservationSummary.java | 28 +- .../models/ReservationsSummaries.java | 8 +- .../consumption/models/Scope.java | 34 - .../consumption/models/Status.java | 46 + .../consumption/models/TagsResult.java | 16 +- .../consumption/models/UsageDetail.java | 2 +- .../consumption/models/UsageDetails.java | 8 +- .../consumption/BudgetsListSamples.java | 20 - .../consumption/CreditsGetSamples.java | 37 - .../EventsOperationListSamples.java | 43 - .../consumption/ForecastsListSamples.java | 44 - .../consumption/LotsOperationListSamples.java | 35 - .../PriceSheetGetByBillingPeriodSamples.java | 33 - ...vationRecommendationDetailsGetSamples.java | 93 - .../consumption/TagsGetSamples.java | 22 - ...egatedCostGetByManagementGroupSamples.java | 24 +- ...BillingPeriodByManagementGroupSamples.java | 12 +- .../BalancesGetByBillingAccountSamples.java | 12 +- ...rBillingPeriodByBillingAccountSamples.java | 12 +- .../BudgetsCreateOrUpdateSamples.java | 19 +- .../{ => generated}/BudgetsDeleteSamples.java | 12 +- .../{ => generated}/BudgetsGetSamples.java | 12 +- .../generated/BudgetsListSamples.java | 22 + .../{ => generated}/ChargesListSamples.java | 134 +- .../generated/CreditsGetSamples.java | 22 + ...sOperationListByBillingAccountSamples.java | 38 + ...sOperationListByBillingProfileSamples.java | 22 + ...sOperationListByBillingAccountSamples.java | 38 + ...sOperationListByBillingProfileSamples.java | 22 + .../MarketplacesListSamples.java | 108 +- .../PriceSheetGetByBillingPeriodSamples.java | 34 + .../{ => generated}/PriceSheetGetSamples.java | 12 +- ...vationRecommendationDetailsGetSamples.java | 73 + ...ReservationRecommendationsListSamples.java | 52 +- ...ansactionsListByBillingProfileSamples.java | 12 +- .../ReservationTransactionsListSamples.java | 12 +- ...ReservationOrderAndReservationSamples.java | 12 +- ...sDetailsListByReservationOrderSamples.java | 12 +- .../ReservationsDetailsListSamples.java | 32 +- ...ReservationOrderAndReservationSamples.java | 22 +- ...ummariesListByReservationOrderSamples.java | 24 +- .../ReservationsSummariesListSamples.java | 62 +- .../consumption/generated/TagsGetSamples.java | 22 + .../UsageDetailsListSamples.java | 194 +- 163 files changed, 11937 insertions(+), 5680 deletions(-) delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ForecastsClient.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastImpl.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsClientImpl.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsImpl.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Bound.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeType.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastPropertiesConfidenceLevelsItem.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecasts.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastsListResult.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Grain.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsListSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/CreditsGetSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/EventsOperationListSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ForecastsListSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/LotsOperationListSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetByBillingPeriodSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationDetailsGetSamples.java delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/TagsGetSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/AggregatedCostGetByManagementGroupSamples.java (59%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java (69%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/BalancesGetByBillingAccountSamples.java (51%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/BalancesGetForBillingPeriodByBillingAccountSamples.java (50%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/BudgetsCreateOrUpdateSamples.java (90%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/BudgetsDeleteSamples.java (62%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/BudgetsGetSamples.java (62%) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ChargesListSamples.java (63%) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/MarketplacesListSamples.java (51%) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/PriceSheetGetSamples.java (51%) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationRecommendationsListSamples.java (62%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationTransactionsListByBillingProfileSamples.java (73%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationTransactionsListSamples.java (67%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsDetailsListByReservationOrderAndReservationSamples.java (73%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsDetailsListByReservationOrderSamples.java (68%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsDetailsListSamples.java (69%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsSummariesListByReservationOrderAndReservationSamples.java (71%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsSummariesListByReservationOrderSamples.java (56%) rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/ReservationsSummariesListSamples.java (67%) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java rename sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/{ => generated}/UsageDetailsListSamples.java (61%) diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index 6c9b32b12cfa..018bb7d8600e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md +++ b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-10-18) +- Azure Resource Manager Consumption client library for Java. This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.2 (2021-07-09) diff --git a/sdk/consumption/azure-resourcemanager-consumption/README.md b/sdk/consumption/azure-resourcemanager-consumption/README.md index e7be16d905f9..4bc0fe107d50 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/README.md +++ b/sdk/consumption/azure-resourcemanager-consumption/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Consumption client library for Java. -This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2019-10. 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 Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. 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-consumption - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md index 7084ef2e62fc..1572efb1c823 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md +++ b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md @@ -1,81 +1,1902 @@ # Code snippets and samples -### AggregatedCost +## AggregatedCost -- [GetByManagementGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetByManagementGroupSamples.java) -- [GetForBillingPeriodByManagementGroup](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java) +- [GetByManagementGroup](#aggregatedcost_getbymanagementgroup) +- [GetForBillingPeriodByManagementGroup](#aggregatedcost_getforbillingperiodbymanagementgroup) -### Balances +## Balances -- [GetByBillingAccount](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetByBillingAccountSamples.java) -- [GetForBillingPeriodByBillingAccount](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetForBillingPeriodByBillingAccountSamples.java) +- [GetByBillingAccount](#balances_getbybillingaccount) +- [GetForBillingPeriodByBillingAccount](#balances_getforbillingperiodbybillingaccount) -### Budgets +## Budgets -- [CreateOrUpdate](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsCreateOrUpdateSamples.java) -- [Delete](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsDeleteSamples.java) -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsGetSamples.java) -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsListSamples.java) +- [CreateOrUpdate](#budgets_createorupdate) +- [Delete](#budgets_delete) +- [Get](#budgets_get) +- [List](#budgets_list) -### Charges +## Charges -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ChargesListSamples.java) +- [List](#charges_list) -### Credits +## Credits -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/CreditsGetSamples.java) +- [Get](#credits_get) -### EventsOperation +## EventsOperation -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/EventsOperationListSamples.java) +- [ListByBillingAccount](#eventsoperation_listbybillingaccount) +- [ListByBillingProfile](#eventsoperation_listbybillingprofile) -### Forecasts +## LotsOperation -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ForecastsListSamples.java) +- [ListByBillingAccount](#lotsoperation_listbybillingaccount) +- [ListByBillingProfile](#lotsoperation_listbybillingprofile) -### LotsOperation +## Marketplaces -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/LotsOperationListSamples.java) +- [List](#marketplaces_list) -### Marketplaces +## PriceSheet -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/MarketplacesListSamples.java) +- [Get](#pricesheet_get) +- [GetByBillingPeriod](#pricesheet_getbybillingperiod) -### PriceSheet +## ReservationRecommendationDetails -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetSamples.java) -- [GetByBillingPeriod](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetByBillingPeriodSamples.java) +- [Get](#reservationrecommendationdetails_get) -### ReservationRecommendationDetails +## ReservationRecommendations -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationDetailsGetSamples.java) +- [List](#reservationrecommendations_list) -### ReservationRecommendations +## ReservationTransactions -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationsListSamples.java) +- [List](#reservationtransactions_list) +- [ListByBillingProfile](#reservationtransactions_listbybillingprofile) -### ReservationTransactions +## ReservationsDetails -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListSamples.java) -- [ListByBillingProfile](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListByBillingProfileSamples.java) +- [List](#reservationsdetails_list) +- [ListByReservationOrder](#reservationsdetails_listbyreservationorder) +- [ListByReservationOrderAndReservation](#reservationsdetails_listbyreservationorderandreservation) -### ReservationsDetails +## ReservationsSummaries -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListSamples.java) -- [ListByReservationOrder](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderSamples.java) -- [ListByReservationOrderAndReservation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderAndReservationSamples.java) +- [List](#reservationssummaries_list) +- [ListByReservationOrder](#reservationssummaries_listbyreservationorder) +- [ListByReservationOrderAndReservation](#reservationssummaries_listbyreservationorderandreservation) -### ReservationsSummaries +## Tags -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListSamples.java) -- [ListByReservationOrder](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderSamples.java) -- [ListByReservationOrderAndReservation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderAndReservationSamples.java) +- [Get](#tags_get) -### Tags +## UsageDetails -- [Get](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/TagsGetSamples.java) +- [List](#usagedetails_list) +### AggregatedCost_GetByManagementGroup -### UsageDetails +```java +import com.azure.core.util.Context; + +/** Samples for AggregatedCost GetByManagementGroup. */ +public final class AggregatedCostGetByManagementGroupSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroupFilterByDate.json + */ + /** + * Sample code: AggregatedCostByManagementGroupFilterByDate. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void aggregatedCostByManagementGroupFilterByDate( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .aggregatedCosts() + .getByManagementGroupWithResponse( + "managementGroupForTest", + "usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroup.json + */ + /** + * Sample code: AggregatedCostByManagementGroup. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void aggregatedCostByManagementGroup( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + } +} +``` + +### AggregatedCost_GetForBillingPeriodByManagementGroup + +```java +import com.azure.core.util.Context; + +/** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ +public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json + */ + /** + * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void aggregatedCostListForBillingPeriodByManagementGroup( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .aggregatedCosts() + .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); + } +} +``` + +### Balances_GetByBillingAccount + +```java +import com.azure.core.util.Context; + +/** Samples for Balances GetByBillingAccount. */ +public final class BalancesGetByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccount.json + */ + /** + * Sample code: Balances. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + } +} +``` + +### Balances_GetForBillingPeriodByBillingAccount + +```java +import com.azure.core.util.Context; + +/** Samples for Balances GetForBillingPeriodByBillingAccount. */ +public final class BalancesGetForBillingPeriodByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccountForBillingPeriod.json + */ + /** + * Sample code: Balances. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + } +} +``` + +### Budgets_CreateOrUpdate + +```java +import com.azure.resourcemanager.consumption.models.BudgetComparisonExpression; +import com.azure.resourcemanager.consumption.models.BudgetFilter; +import com.azure.resourcemanager.consumption.models.BudgetFilterProperties; +import com.azure.resourcemanager.consumption.models.BudgetOperatorType; +import com.azure.resourcemanager.consumption.models.BudgetTimePeriod; +import com.azure.resourcemanager.consumption.models.CategoryType; +import com.azure.resourcemanager.consumption.models.Notification; +import com.azure.resourcemanager.consumption.models.OperatorType; +import com.azure.resourcemanager.consumption.models.ThresholdType; +import com.azure.resourcemanager.consumption.models.TimeGrainType; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for Budgets CreateOrUpdate. */ +public final class BudgetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreateOrUpdateBudget.json + */ + /** + * Sample code: CreateOrUpdateBudget. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void createOrUpdateBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .budgets() + .define("TestBudget") + .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withEtag("\"1d34d016a593709\"") + .withCategory(CategoryType.COST) + .withAmount(new BigDecimal("100.65")) + .withTimeGrain(TimeGrainType.MONTHLY) + .withTimePeriod( + new BudgetTimePeriod() + .withStartDate(OffsetDateTime.parse("2017-10-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2018-10-31T00:00:00Z"))) + .withFilter( + new BudgetFilter() + .withAnd( + Arrays + .asList( + new BudgetFilterProperties() + .withDimensions( + new BudgetComparisonExpression() + .withName("ResourceId") + .withOperator(BudgetOperatorType.IN) + .withValues( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), + new BudgetFilterProperties() + .withTags( + new BudgetComparisonExpression() + .withName("category") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("Dev", "Prod"))), + new BudgetFilterProperties() + .withTags( + new BudgetComparisonExpression() + .withName("department") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("engineering", "sales")))))) + .withNotifications( + mapOf( + "Actual_GreaterThan_80_Percent", + new Notification() + .withEnabled(true) + .withOperator(OperatorType.GREATER_THAN) + .withThreshold(new BigDecimal("80")) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withContactRoles(Arrays.asList("Contributor", "Reader")) + .withContactGroups( + Arrays + .asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) + .withThresholdType(ThresholdType.ACTUAL))) + .create(); + } + + @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; + } +} +``` + +### Budgets_Delete + +```java +import com.azure.core.util.Context; + +/** Samples for Budgets Delete. */ +public final class BudgetsDeleteSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/DeleteBudget.json + */ + /** + * Sample code: DeleteBudget. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .budgets() + .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + } +} +``` + +### Budgets_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Budgets Get. */ +public final class BudgetsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Budget.json + */ + /** + * Sample code: Budget. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .budgets() + .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + } +} +``` + +### Budgets_List + +```java +import com.azure.core.util.Context; + +/** Samples for Budgets List. */ +public final class BudgetsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BudgetsList.json + */ + /** + * Sample code: BudgetsList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + } +} +``` + +### Charges_List + +```java +import com.azure.core.util.Context; + +/** Samples for Charges List. */ +public final class ChargesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccount.json + */ + /** + * Sample code: ChargesListByBillingAccount-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingAccountModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789", + "2019-09-01", + "2019-10-31", + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json + */ + /** + * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void changesForBillingPeriodByEnrollmentAccountLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json + */ + /** + * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingAccountGroupByCustomerIdModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789", + "2019-09-01", + "2019-09-30", + null, + "groupby((properties/customerId))", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfile.json + */ + /** + * Sample code: ChargesListByBillingProfile-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingProfileModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileInvoiceSection.json + */ + /** + * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingProfileInvoiceSectionModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425/invoiceSections/67890", + "2019-09-01", + "2019-10-31", + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernCustomer.json + */ + /** + * Sample code: ChargesListByCustomer-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByCustomerModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForDepartmentFilterByStartEndDate.json + */ + /** + * Sample code: ChargesListByDepartment-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", + null, + null, + "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json + */ + /** + * Sample code: ChargesListForEnrollmentAccount-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListForEnrollmentAccountLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + */ + /** + * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", + "2019-09-30", + null, + "groupby((properties/invoiceSectionId))", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json + */ + /** + * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingAccountGroupByBillingProfileIdModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789", + "2019-09-01", + "2019-09-30", + null, + "groupby((properties/billingProfileId))", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json + */ + /** + * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", + "2019-09-30", + null, + "groupby((properties/invoiceSectionId))", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByDepartment.json + */ + /** + * Sample code: ChangesForBillingPeriodByDepartment-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void changesForBillingPeriodByDepartmentLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernInvoiceSectionId.json + */ + /** + * Sample code: ChargesListByInvoiceSectionId-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void chargesListByInvoiceSectionIdModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .charges() + .listWithResponse( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", + null, + null, + null, + null, + Context.NONE); + } +} +``` + +### Credits_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Credits Get. */ +public final class CreditsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreditSummaryByBillingProfile.json + */ + /** + * Sample code: CreditSummaryByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + } +} +``` + +### EventsOperation_ListByBillingAccount + +```java +import com.azure.core.util.Context; + +/** Samples for EventsOperation ListByBillingAccount. */ +public final class EventsOperationListByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccount.json + */ + /** + * Sample code: EventsGetByBillingAccount. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccountWithFilters.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsGetByBillingAccountWithFilters( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .eventsOperations() + .listByBillingAccount( + "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + } +} +``` + +### EventsOperation_ListByBillingProfile + +```java +import com.azure.core.util.Context; + +/** Samples for EventsOperation ListByBillingProfile. */ +public final class EventsOperationListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsListByBillingProfile.json + */ + /** + * Sample code: EventsListByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + } +} +``` + +### LotsOperation_ListByBillingAccount + +```java +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByBillingAccount. */ +public final class LotsOperationListByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccount.json + */ + /** + * Sample code: LotsListByBillingAccount. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccountWithFilters.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccountWithStatusFilter( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .lotsOperations() + .listByBillingAccount( + "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + } +} +``` + +### LotsOperation_ListByBillingProfile + +```java +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByBillingProfile. */ +public final class LotsOperationListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingProfile.json + */ + /** + * Sample code: LotsListByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + } +} +``` + +### Marketplaces_List + +```java +import com.azure.core.util.Context; + +/** Samples for Marketplaces List. */ +public final class MarketplacesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json + */ + /** + * Sample code: BillingAccountMarketplacesListForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingAccountMarketplacesListForBillingPeriod( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json + */ + /** + * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void enrollmentAccountMarketplacesListForBillingPeriod( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesList.json + */ + /** + * Sample code: SubscriptionMarketplacesList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccountList.json + */ + /** + * Sample code: EnrollmentAccountMarketplacesList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void enrollmentAccountMarketplacesList( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json + */ + /** + * Sample code: DepartmentMarketplacesListForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void departmentMarketplacesListForBillingPeriod( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroupList.json + */ + /** + * Sample code: ManagementGroupMarketplacesList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void managementGroupMarketplacesList( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesListForBillingPeriod.json + */ + /** + * Sample code: SubscriptionMarketplacesListForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void subscriptionMarketplacesListForBillingPeriod( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartmentList.json + */ + /** + * Sample code: DepartmentMarketplacesList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json + */ + /** + * Sample code: ManagementGroupMarketplacesListForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void managementGroupMarketplacesListForBillingPeriod( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountList.json + */ + /** + * Sample code: BillingAccountMarketplacesList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingAccountMarketplacesList( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .marketplaces() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + } +} +``` + +### PriceSheet_Get + +```java +import com.azure.core.util.Context; + +/** Samples for PriceSheet Get. */ +public final class PriceSheetGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheet.json + */ + /** + * Sample code: PriceSheet. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getWithResponse(null, null, null, Context.NONE); + } +} +``` + +### PriceSheet_GetByBillingPeriod + +```java +import com.azure.core.util.Context; + +/** Samples for PriceSheet GetByBillingPeriod. */ +public final class PriceSheetGetByBillingPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetForBillingPeriod.json + */ + /** + * Sample code: PriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetExpand.json + */ + /** + * Sample code: PriceSheetExpand. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + } +} +``` + +### ReservationRecommendationDetails_Get + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Term; + +/** Samples for ReservationRecommendationDetails Get. */ +public final class ReservationRecommendationDetailsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsBySubscription.json + */ + /** + * Sample code: ReservationRecommendationsBySubscription-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsBySubscriptionLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingProfile.json + */ + /** + * Sample code: ReservationRecommendationsByBillingProfile-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingProfileModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse( + "Shared", "australiaeast", Term.P1Y, LookBackPeriod.LAST7DAYS, "Standard_B2s", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByResourceGroup.json + */ + /** + * Sample code: ReservationRecommendationsByResourceGroup-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByResourceGroupLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingAccount.json + */ + /** + * Sample code: ReservationRecommendationsByBillingAccount-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingAccountLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + } +} +``` + +### ReservationRecommendations_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationRecommendations List. */ +public final class ReservationRecommendationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsBySubscription.json + */ + /** + * Sample code: ReservationRecommendationsBySubscription-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsBySubscriptionLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendations() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json + */ + /** + * Sample code: ReservationRecommendationsByBillingProfile-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingProfileModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendations() + .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByResourceGroup.json + */ + /** + * Sample code: ReservationRecommendationsByResourceGroup-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByResourceGroupLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendations() + .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json + */ + /** + * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendations() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + "properties/scope eq 'Single' AND properties/lookBackPeriod eq 'Last7Days'", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json + */ + /** + * Sample code: ReservationRecommendationsByBillingAccount-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingAccountLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendations() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); + } +} +``` + +### ReservationTransactions_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationTransactions List. */ +public final class ReservationTransactionsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByEnrollmentNumber.json + */ + /** + * Sample code: ReservationTransactionsByEnrollmentNumber. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationTransactionsByEnrollmentNumber( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationTransactions() + .list("123456", "properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30", Context.NONE); + } +} +``` + +### ReservationTransactions_ListByBillingProfile + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationTransactions ListByBillingProfile. */ +public final class ReservationTransactionsListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByBillingProfileId.json + */ + /** + * Sample code: ReservationTransactionsByBillingProfileId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationTransactionsByBillingProfileId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationTransactions() + .listByBillingProfile( + "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", + "Z76D-SGAF-BG7-TGB", + "properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30", + Context.NONE); + } +} +``` + +### ReservationsDetails_List + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationsDetails List. */ +public final class ReservationsDetailsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileIdReservationId.json + */ + /** + * Sample code: ReservationDetailsByBillingProfileIdReservationId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationDetailsByBillingProfileIdReservationId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsDetails() + .list( + "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", + "2019-09-01", + "2019-10-31", + null, + "1c6b6358-709f-484c-85f1-72e862a0cf3b", + "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingAccountId.json + */ + /** + * Sample code: ReservationDetailsByBillingAccountId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationDetailsByBillingAccountId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsDetails() + .list( + "providers/Microsoft.Billing/billingAccounts/12345", + null, + null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileId.json + */ + /** + * Sample code: ReservationDetailsByBillingProfileId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationDetailsByBillingProfileId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsDetails() + .list( + "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", + "2019-09-01", + "2019-10-31", + null, + null, + null, + Context.NONE); + } +} +``` + +### ReservationsDetails_ListByReservationOrder + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationsDetails ListByReservationOrder. */ +public final class ReservationsDetailsListByReservationOrderSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetails.json + */ + /** + * Sample code: ReservationDetails. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationDetails(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsDetails() + .listByReservationOrder( + "00000000-0000-0000-0000-000000000000", + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", + Context.NONE); + } +} +``` + +### ReservationsDetails_ListByReservationOrderAndReservation + +```java +import com.azure.core.util.Context; + +/** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ +public final class ReservationsDetailsListByReservationOrderAndReservationSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsWithReservationId.json + */ + /** + * Sample code: ReservationDetailsWithReservationId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationDetailsWithReservationId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsDetails() + .listByReservationOrderAndReservation( + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", + Context.NONE); + } +} +``` + +### ReservationsSummaries_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.Datagrain; + +/** Samples for ReservationsSummaries List. */ +public final class ReservationsSummariesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingAccountId.json + */ + /** + * Sample code: ReservationSummariesDailyWithBillingAccountId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesDailyWithBillingAccountId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .list( + "providers/Microsoft.Billing/billingAccounts/12345", + Datagrain.DAILY, + null, + null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingProfileId.json + */ + /** + * Sample code: ReservationSummariesDailyWithBillingProfileId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesDailyWithBillingProfileId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .list( + "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", + Datagrain.DAILY, + "2017-10-01", + "2017-11-20", + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json + */ + /** + * Sample code: ReservationSummariesMonthlyWithBillingAccountId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesMonthlyWithBillingAccountId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .list( + "providers/Microsoft.Billing/billingAccounts/12345", + Datagrain.MONTHLY, + null, + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json + */ + /** + * Sample code: ReservationSummariesMonthlyWithBillingProfileId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesMonthlyWithBillingProfileId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .list( + "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", + Datagrain.MONTHLY, + null, + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + */ + /** + * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesMonthlyWithBillingProfileIdReservationId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .list( + "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", + Datagrain.MONTHLY, + null, + null, + null, + "1c6b6358-709f-484c-85f1-72e862a0cf3b", + "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + Context.NONE); + } +} +``` + +### ReservationsSummaries_ListByReservationOrder + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.Datagrain; + +/** Samples for ReservationsSummaries ListByReservationOrder. */ +public final class ReservationsSummariesListByReservationOrderSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthly.json + */ + /** + * Sample code: ReservationSummariesMonthly. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDaily.json + */ + /** + * Sample code: ReservationSummariesDaily. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesDaily(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .listByReservationOrder( + "00000000-0000-0000-0000-000000000000", + Datagrain.DAILY, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", + Context.NONE); + } +} +``` + +### ReservationsSummaries_ListByReservationOrderAndReservation + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.Datagrain; + +/** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ +public final class ReservationsSummariesListByReservationOrderAndReservationSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithReservationId.json + */ + /** + * Sample code: ReservationSummariesDailyWithReservationId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesDailyWithReservationId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .listByReservationOrderAndReservation( + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", + Datagrain.DAILY, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithReservationId.json + */ + /** + * Sample code: ReservationSummariesMonthlyWithReservationId. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationSummariesMonthlyWithReservationId( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationsSummaries() + .listByReservationOrderAndReservation( + "00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", + Datagrain.MONTHLY, + null, + Context.NONE); + } +} +``` + +### Tags_Get + +```java +import com.azure.core.util.Context; + +/** Samples for Tags Get. */ +public final class TagsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Tags.json + */ + /** + * Sample code: Tags_Get. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + } +} +``` + +### UsageDetails_List + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.Metrictype; + +/** Samples for UsageDetails List. */ +public final class UsageDetailsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json + */ + /** + * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingAccountUsageDetailsListForBillingPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCAInvoiceSection.json + */ + /** + * Sample code: InvoiceSectionUsageDetailsList-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void invoiceSectionUsageDetailsListModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", + null, + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsList.json + */ + /** + * Sample code: UsageDetailsList-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListFilterByTag.json + */ + /** + * Sample code: UsageDetailsListFilterByTag-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListFilterByTagLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + "tags eq 'dev:tools'", + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByBillingAccount.json + */ + /** + * Sample code: BillingAccountUsageDetailsList-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingAccountUsageDetailsListLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingProfile.json + */ + /** + * Sample code: BillingProfileUsageDetailsList-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingProfileUsageDetailsListModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", + null, + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByDepartment.json + */ + /** + * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void departmentUsageDetailsListForBillingPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json + */ + /** + * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void managementGroupUsageDetailsListForBillingPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricAmortizedCost.json + */ + /** + * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListByMetricAmortizedCostLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + Metrictype.AMORTIZEDCOST, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricUsage.json + */ + /** + * Sample code: UsageDetailsListByMetricUsage-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListByMetricUsageLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + Metrictype.USAGE, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByManagementGroup.json + */ + /** + * Sample code: ManagementGroupUsageDetailsList-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void managementGroupUsageDetailsListLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByDepartment.json + */ + /** + * Sample code: DepartmentUsageDetailsList-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void departmentUsageDetailsListLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricActualCost.json + */ + /** + * Sample code: UsageDetailsListByMetricActualCost-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListByMetricActualCostLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + Metrictype.ACTUALCOST, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByEnrollmentAccount.json + */ + /** + * Sample code: EnrollmentAccountUsageDetailsList-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void enrollmentAccountUsageDetailsListLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingAccount.json + */ + /** + * Sample code: BillingAccountUsageDetailsList-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void billingAccountUsageDetailsListModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCACustomer.json + */ + /** + * Sample code: CustomerUsageDetailsList-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void customerUsageDetailsListModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsExpand.json + */ + /** + * Sample code: UsageDetailsExpand-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsExpandLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + "meterDetails,additionalInfo", + "tags eq 'dev:tools'", + null, + 1, + null, + Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json + */ + /** + * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void enrollmentAccountUsageDetailsListForBillingPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriod.json + */ + /** + * Sample code: UsageDetailsListForBillingPeriod-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void usageDetailsListForBillingPeriodLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + } +} +``` -- [List](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/UsageDetailsListSamples.java) diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml index 54d50cc5bebb..aa277b3177a1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/pom.xml +++ b/sdk/consumption/azure-resourcemanager-consumption/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for Consumption Management - This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2019-10. + This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java index 9c82321944af..adf26cfeb282 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java @@ -28,7 +28,6 @@ import com.azure.resourcemanager.consumption.implementation.ConsumptionManagementClientBuilder; import com.azure.resourcemanager.consumption.implementation.CreditsImpl; import com.azure.resourcemanager.consumption.implementation.EventsOperationsImpl; -import com.azure.resourcemanager.consumption.implementation.ForecastsImpl; import com.azure.resourcemanager.consumption.implementation.LotsOperationsImpl; import com.azure.resourcemanager.consumption.implementation.MarketplacesImpl; import com.azure.resourcemanager.consumption.implementation.OperationsImpl; @@ -46,7 +45,6 @@ import com.azure.resourcemanager.consumption.models.Charges; import com.azure.resourcemanager.consumption.models.Credits; import com.azure.resourcemanager.consumption.models.EventsOperations; -import com.azure.resourcemanager.consumption.models.Forecasts; import com.azure.resourcemanager.consumption.models.LotsOperations; import com.azure.resourcemanager.consumption.models.Marketplaces; import com.azure.resourcemanager.consumption.models.Operations; @@ -93,8 +91,6 @@ public final class ConsumptionManager { private PriceSheets priceSheets; - private Forecasts forecasts; - private Operations operations; private AggregatedCosts aggregatedCosts; @@ -241,7 +237,7 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.consumption") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -379,14 +375,6 @@ public PriceSheets priceSheets() { return priceSheets; } - /** @return Resource collection API of Forecasts. */ - public Forecasts forecasts() { - if (this.forecasts == null) { - this.forecasts = new ForecastsImpl(clientObject.getForecasts(), this); - } - return forecasts; - } - /** @return Resource collection API of Operations. */ public Operations operations() { if (this.operations == null) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java index ecf718cfb97f..d27deeac3726 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java @@ -128,13 +128,6 @@ public interface ConsumptionManagementClient { */ PriceSheetsClient getPriceSheets(); - /** - * Gets the ForecastsClient object to access its operations. - * - * @return the ForecastsClient object. - */ - ForecastsClient getForecasts(); - /** * Gets the OperationsClient object to access its operations. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java index 641cd0d201da..4a9bba8b64c6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java @@ -15,27 +15,21 @@ public interface CreditsClient { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CreditSummaryInner get(String scope); + CreditSummaryInner get(String billingAccountId, String billingProfileId); /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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,5 +37,5 @@ public interface CreditsClient { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, Context context); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java index 288eba9cff34..7591c8b7840b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/EventsOperationsClient.java @@ -13,33 +13,30 @@ /** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ public interface EventsOperationsClient { /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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 event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String startDate, String endDate, String scope); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate); /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. @@ -47,5 +44,36 @@ public interface EventsOperationsClient { * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String startDate, String endDate, String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @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 event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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 result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ForecastsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ForecastsClient.java deleted file mode 100644 index 5290f74fa089..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ForecastsClient.java +++ /dev/null @@ -1,43 +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.consumption.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; - -/** An instance of this class provides access to all the operations defined in ForecastsClient. */ -public interface ForecastsClient { - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String filter, Context context); -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java index f168f2b33170..6c7db7249652 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java @@ -13,29 +13,25 @@ /** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ public interface LotsOperationsClient { /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId); /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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,5 +39,36 @@ public interface LotsOperationsClient { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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 result of listing lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java index 840cb18b61d4..083b16f7e65c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java @@ -13,19 +13,17 @@ /** An instance of this class provides access to all the operations defined in PriceSheetsClient. */ public interface PriceSheetsClient { /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) PriceSheetResultInner get(); /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -37,7 +35,7 @@ public interface PriceSheetsClient { * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String expand, String skiptoken, Integer top, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java index a9742765369c..042ad2b40fdd 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java @@ -10,7 +10,6 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner; import com.azure.resourcemanager.consumption.models.LookBackPeriod; -import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; /** @@ -20,13 +19,12 @@ public interface ReservationRecommendationDetailsClient { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -39,18 +37,17 @@ public interface ReservationRecommendationDetailsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) ReservationRecommendationDetailsModelInner get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -64,11 +61,5 @@ ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String billingScope, - Scope scope, - String region, - Term term, - LookBackPeriod lookBackPeriod, - String product, - Context context); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java index 1a64f3ccbd7e..40be069d1339 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java @@ -100,10 +100,10 @@ PagedIterable listByReservationOrderAndReservation( * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/UsageDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/UsageDetailsClient.java index 429193dbd4c4..e89c21afee28 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/UsageDetailsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/UsageDetailsClient.java @@ -15,8 +15,7 @@ public interface UsageDetailsClient { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -45,8 +44,7 @@ public interface UsageDetailsClient { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -67,7 +65,7 @@ public interface UsageDetailsClient { * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java index c4ddf96fa00a..be4d23435c3b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java @@ -5,126 +5,68 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem; import com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem; import com.azure.resourcemanager.consumption.models.BillingFrequency; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.List; import java.util.Map; /** A balance resource. */ -@JsonFlatten @Fluent -public class BalanceInner extends ProxyResource { +public final class BalanceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(BalanceInner.class); /* - * The ISO currency in which the meter is charged, for example, USD. + * The properties of the balance. */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; + @JsonProperty(value = "properties") + private BalanceProperties innerProperties; /* - * The beginning balance for the billing period. + * The etag for the resource. */ - @JsonProperty(value = "properties.beginningBalance", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal beginningBalance; - - /* - * The ending balance for the billing period (for open periods this will be - * updated daily). - */ - @JsonProperty(value = "properties.endingBalance", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal endingBalance; - - /* - * Total new purchase amount. - */ - @JsonProperty(value = "properties.newPurchases", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal newPurchases; - - /* - * Total adjustment amount. - */ - @JsonProperty(value = "properties.adjustments", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal adjustments; - - /* - * Total Commitment usage. - */ - @JsonProperty(value = "properties.utilized", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal utilized; - - /* - * Overage for Azure services. - */ - @JsonProperty(value = "properties.serviceOverage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal serviceOverage; - - /* - * Charges Billed separately. - */ - @JsonProperty(value = "properties.chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal chargesBilledSeparately; - - /* - * serviceOverage + chargesBilledSeparately. - */ - @JsonProperty(value = "properties.totalOverage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal totalOverage; - - /* - * Azure service commitment + total Overage. - */ - @JsonProperty(value = "properties.totalUsage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal totalUsage; - - /* - * Total charges for Azure Marketplace. - */ - @JsonProperty(value = "properties.azureMarketplaceServiceCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal azureMarketplaceServiceCharges; - - /* - * The billing frequency. - */ - @JsonProperty(value = "properties.billingFrequency") - private BillingFrequency billingFrequency; - - /* - * Price is hidden or not. - */ - @JsonProperty(value = "properties.priceHidden", access = JsonProperty.Access.WRITE_ONLY) - private Boolean priceHidden; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * List of new purchases. + * Resource tags. */ - @JsonProperty(value = "properties.newPurchasesDetails", access = JsonProperty.Access.WRITE_ONLY) - private List newPurchasesDetails; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * List of Adjustments (Promo credit, SIE credit etc.). + /** + * Get the innerProperties property: The properties of the balance. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.adjustmentDetails", access = JsonProperty.Access.WRITE_ONLY) - private List adjustmentDetails; + private BalanceProperties innerProperties() { + return this.innerProperties; + } - /* - * Resource etag. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public String etag() { + return this.etag; + } - /* - * Resource tags. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Map tags() { + return this.tags; + } /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. @@ -132,7 +74,7 @@ public class BalanceInner extends ProxyResource { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -141,7 +83,7 @@ public String currency() { * @return the beginningBalance value. */ public BigDecimal beginningBalance() { - return this.beginningBalance; + return this.innerProperties() == null ? null : this.innerProperties().beginningBalance(); } /** @@ -151,7 +93,7 @@ public BigDecimal beginningBalance() { * @return the endingBalance value. */ public BigDecimal endingBalance() { - return this.endingBalance; + return this.innerProperties() == null ? null : this.innerProperties().endingBalance(); } /** @@ -160,7 +102,7 @@ public BigDecimal endingBalance() { * @return the newPurchases value. */ public BigDecimal newPurchases() { - return this.newPurchases; + return this.innerProperties() == null ? null : this.innerProperties().newPurchases(); } /** @@ -169,7 +111,7 @@ public BigDecimal newPurchases() { * @return the adjustments value. */ public BigDecimal adjustments() { - return this.adjustments; + return this.innerProperties() == null ? null : this.innerProperties().adjustments(); } /** @@ -178,7 +120,7 @@ public BigDecimal adjustments() { * @return the utilized value. */ public BigDecimal utilized() { - return this.utilized; + return this.innerProperties() == null ? null : this.innerProperties().utilized(); } /** @@ -187,7 +129,7 @@ public BigDecimal utilized() { * @return the serviceOverage value. */ public BigDecimal serviceOverage() { - return this.serviceOverage; + return this.innerProperties() == null ? null : this.innerProperties().serviceOverage(); } /** @@ -196,7 +138,7 @@ public BigDecimal serviceOverage() { * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { - return this.chargesBilledSeparately; + return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); } /** @@ -205,7 +147,7 @@ public BigDecimal chargesBilledSeparately() { * @return the totalOverage value. */ public BigDecimal totalOverage() { - return this.totalOverage; + return this.innerProperties() == null ? null : this.innerProperties().totalOverage(); } /** @@ -214,7 +156,7 @@ public BigDecimal totalOverage() { * @return the totalUsage value. */ public BigDecimal totalUsage() { - return this.totalUsage; + return this.innerProperties() == null ? null : this.innerProperties().totalUsage(); } /** @@ -223,7 +165,7 @@ public BigDecimal totalUsage() { * @return the azureMarketplaceServiceCharges value. */ public BigDecimal azureMarketplaceServiceCharges() { - return this.azureMarketplaceServiceCharges; + return this.innerProperties() == null ? null : this.innerProperties().azureMarketplaceServiceCharges(); } /** @@ -232,7 +174,7 @@ public BigDecimal azureMarketplaceServiceCharges() { * @return the billingFrequency value. */ public BillingFrequency billingFrequency() { - return this.billingFrequency; + return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); } /** @@ -242,7 +184,10 @@ public BillingFrequency billingFrequency() { * @return the BalanceInner object itself. */ public BalanceInner withBillingFrequency(BillingFrequency billingFrequency) { - this.billingFrequency = billingFrequency; + if (this.innerProperties() == null) { + this.innerProperties = new BalanceProperties(); + } + this.innerProperties().withBillingFrequency(billingFrequency); return this; } @@ -252,7 +197,7 @@ public BalanceInner withBillingFrequency(BillingFrequency billingFrequency) { * @return the priceHidden value. */ public Boolean priceHidden() { - return this.priceHidden; + return this.innerProperties() == null ? null : this.innerProperties().priceHidden(); } /** @@ -261,7 +206,7 @@ public Boolean priceHidden() { * @return the newPurchasesDetails value. */ public List newPurchasesDetails() { - return this.newPurchasesDetails; + return this.innerProperties() == null ? null : this.innerProperties().newPurchasesDetails(); } /** @@ -270,25 +215,7 @@ public List newPurchasesDetails() { * @return the adjustmentDetails value. */ public List adjustmentDetails() { - return this.adjustmentDetails; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().adjustmentDetails(); } /** @@ -297,11 +224,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (newPurchasesDetails() != null) { - newPurchasesDetails().forEach(e -> e.validate()); - } - if (adjustmentDetails() != null) { - adjustmentDetails().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java new file mode 100644 index 000000000000..f0e15ad53cf2 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem; +import com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem; +import com.azure.resourcemanager.consumption.models.BillingFrequency; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.List; + +/** The properties of the balance. */ +@Fluent +public final class BalanceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BalanceProperties.class); + + /* + * The ISO currency in which the meter is charged, for example, USD. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * The beginning balance for the billing period. + */ + @JsonProperty(value = "beginningBalance", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal beginningBalance; + + /* + * The ending balance for the billing period (for open periods this will be + * updated daily). + */ + @JsonProperty(value = "endingBalance", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal endingBalance; + + /* + * Total new purchase amount. + */ + @JsonProperty(value = "newPurchases", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal newPurchases; + + /* + * Total adjustment amount. + */ + @JsonProperty(value = "adjustments", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal adjustments; + + /* + * Total Commitment usage. + */ + @JsonProperty(value = "utilized", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal utilized; + + /* + * Overage for Azure services. + */ + @JsonProperty(value = "serviceOverage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal serviceOverage; + + /* + * Charges Billed separately. + */ + @JsonProperty(value = "chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal chargesBilledSeparately; + + /* + * serviceOverage + chargesBilledSeparately. + */ + @JsonProperty(value = "totalOverage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal totalOverage; + + /* + * Azure service commitment + total Overage. + */ + @JsonProperty(value = "totalUsage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal totalUsage; + + /* + * Total charges for Azure Marketplace. + */ + @JsonProperty(value = "azureMarketplaceServiceCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal azureMarketplaceServiceCharges; + + /* + * The billing frequency. + */ + @JsonProperty(value = "billingFrequency") + private BillingFrequency billingFrequency; + + /* + * Price is hidden or not. + */ + @JsonProperty(value = "priceHidden", access = JsonProperty.Access.WRITE_ONLY) + private Boolean priceHidden; + + /* + * List of new purchases. + */ + @JsonProperty(value = "newPurchasesDetails", access = JsonProperty.Access.WRITE_ONLY) + private List newPurchasesDetails; + + /* + * List of Adjustments (Promo credit, SIE credit etc.). + */ + @JsonProperty(value = "adjustmentDetails", access = JsonProperty.Access.WRITE_ONLY) + private List adjustmentDetails; + + /** + * Get the currency property: The ISO currency in which the meter is charged, for example, USD. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the beginningBalance property: The beginning balance for the billing period. + * + * @return the beginningBalance value. + */ + public BigDecimal beginningBalance() { + return this.beginningBalance; + } + + /** + * Get the endingBalance property: The ending balance for the billing period (for open periods this will be updated + * daily). + * + * @return the endingBalance value. + */ + public BigDecimal endingBalance() { + return this.endingBalance; + } + + /** + * Get the newPurchases property: Total new purchase amount. + * + * @return the newPurchases value. + */ + public BigDecimal newPurchases() { + return this.newPurchases; + } + + /** + * Get the adjustments property: Total adjustment amount. + * + * @return the adjustments value. + */ + public BigDecimal adjustments() { + return this.adjustments; + } + + /** + * Get the utilized property: Total Commitment usage. + * + * @return the utilized value. + */ + public BigDecimal utilized() { + return this.utilized; + } + + /** + * Get the serviceOverage property: Overage for Azure services. + * + * @return the serviceOverage value. + */ + public BigDecimal serviceOverage() { + return this.serviceOverage; + } + + /** + * Get the chargesBilledSeparately property: Charges Billed separately. + * + * @return the chargesBilledSeparately value. + */ + public BigDecimal chargesBilledSeparately() { + return this.chargesBilledSeparately; + } + + /** + * Get the totalOverage property: serviceOverage + chargesBilledSeparately. + * + * @return the totalOverage value. + */ + public BigDecimal totalOverage() { + return this.totalOverage; + } + + /** + * Get the totalUsage property: Azure service commitment + total Overage. + * + * @return the totalUsage value. + */ + public BigDecimal totalUsage() { + return this.totalUsage; + } + + /** + * Get the azureMarketplaceServiceCharges property: Total charges for Azure Marketplace. + * + * @return the azureMarketplaceServiceCharges value. + */ + public BigDecimal azureMarketplaceServiceCharges() { + return this.azureMarketplaceServiceCharges; + } + + /** + * Get the billingFrequency property: The billing frequency. + * + * @return the billingFrequency value. + */ + public BillingFrequency billingFrequency() { + return this.billingFrequency; + } + + /** + * Set the billingFrequency property: The billing frequency. + * + * @param billingFrequency the billingFrequency value to set. + * @return the BalanceProperties object itself. + */ + public BalanceProperties withBillingFrequency(BillingFrequency billingFrequency) { + this.billingFrequency = billingFrequency; + return this; + } + + /** + * Get the priceHidden property: Price is hidden or not. + * + * @return the priceHidden value. + */ + public Boolean priceHidden() { + return this.priceHidden; + } + + /** + * Get the newPurchasesDetails property: List of new purchases. + * + * @return the newPurchasesDetails value. + */ + public List newPurchasesDetails() { + return this.newPurchasesDetails; + } + + /** + * Get the adjustmentDetails property: List of Adjustments (Promo credit, SIE credit etc.). + * + * @return the adjustmentDetails value. + */ + public List adjustmentDetails() { + return this.adjustmentDetails; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (newPurchasesDetails() != null) { + newPurchasesDetails().forEach(e -> e.validate()); + } + if (adjustmentDetails() != null) { + adjustmentDetails().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java index 72d64fe120a3..f8fea1a4e18b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BudgetFilter; @@ -21,73 +20,54 @@ import java.util.Map; /** A budget resource. */ -@JsonFlatten @Fluent -public class BudgetInner extends ProxyResource { +public final class BudgetInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetInner.class); /* - * The category of the budget, whether the budget tracks cost or usage. + * The properties of the budget. */ - @JsonProperty(value = "properties.category") - private CategoryType category; + @JsonProperty(value = "properties") + private BudgetProperties innerProperties; /* - * The total amount of cost to track with the budget - */ - @JsonProperty(value = "properties.amount") - private BigDecimal amount; - - /* - * The time covered by a budget. Tracking of the amount will be reset based - * on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are - * only supported by WD customers - */ - @JsonProperty(value = "properties.timeGrain") - private TimeGrainType timeGrain; - - /* - * Has start and end date of the budget. The start date must be first of - * the month and should be less than the end date. Budget start date must - * be on or after June 1, 2017. Future start date should not be more than - * twelve months. Past start date should be selected within the timegrain - * period. There are no restrictions on the end date. - */ - @JsonProperty(value = "properties.timePeriod") - private BudgetTimePeriod timePeriod; - - /* - * May be used to filter budgets by user-specified dimensions and/or tags. - */ - @JsonProperty(value = "properties.filter") - private BudgetFilter filter; - - /* - * The current amount of cost which is being tracked for a budget. + * eTag of the resource. To handle concurrent update scenario, this field + * will be used to determine whether the user is updating the latest + * version or not. */ - @JsonProperty(value = "properties.currentSpend", access = JsonProperty.Access.WRITE_ONLY) - private CurrentSpend currentSpend; + @JsonProperty(value = "eTag") + private String etag; - /* - * Dictionary of notifications associated with the budget. Budget can have - * up to five notifications. + /** + * Get the innerProperties property: The properties of the budget. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.notifications") - private Map notifications; + private BudgetProperties innerProperties() { + return this.innerProperties; + } - /* - * The forecasted cost which is being tracked for a budget. + /** + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. */ - @JsonProperty(value = "properties.forecastSpend", access = JsonProperty.Access.WRITE_ONLY) - private ForecastSpend forecastSpend; + public String etag() { + return this.etag; + } - /* - * eTag of the resource. To handle concurrent update scenario, this field - * will be used to determine whether the user is updating the latest - * version or not. + /** + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param etag the etag value to set. + * @return the BudgetInner object itself. */ - @JsonProperty(value = "eTag") - private String etag; + public BudgetInner withEtag(String etag) { + this.etag = etag; + return this; + } /** * Get the category property: The category of the budget, whether the budget tracks cost or usage. @@ -95,7 +75,7 @@ public class BudgetInner extends ProxyResource { * @return the category value. */ public CategoryType category() { - return this.category; + return this.innerProperties() == null ? null : this.innerProperties().category(); } /** @@ -105,7 +85,10 @@ public CategoryType category() { * @return the BudgetInner object itself. */ public BudgetInner withCategory(CategoryType category) { - this.category = category; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withCategory(category); return this; } @@ -115,7 +98,7 @@ public BudgetInner withCategory(CategoryType category) { * @return the amount value. */ public BigDecimal amount() { - return this.amount; + return this.innerProperties() == null ? null : this.innerProperties().amount(); } /** @@ -125,7 +108,10 @@ public BigDecimal amount() { * @return the BudgetInner object itself. */ public BudgetInner withAmount(BigDecimal amount) { - this.amount = amount; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withAmount(amount); return this; } @@ -136,7 +122,7 @@ public BudgetInner withAmount(BigDecimal amount) { * @return the timeGrain value. */ public TimeGrainType timeGrain() { - return this.timeGrain; + return this.innerProperties() == null ? null : this.innerProperties().timeGrain(); } /** @@ -147,7 +133,10 @@ public TimeGrainType timeGrain() { * @return the BudgetInner object itself. */ public BudgetInner withTimeGrain(TimeGrainType timeGrain) { - this.timeGrain = timeGrain; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withTimeGrain(timeGrain); return this; } @@ -160,7 +149,7 @@ public BudgetInner withTimeGrain(TimeGrainType timeGrain) { * @return the timePeriod value. */ public BudgetTimePeriod timePeriod() { - return this.timePeriod; + return this.innerProperties() == null ? null : this.innerProperties().timePeriod(); } /** @@ -173,7 +162,10 @@ public BudgetTimePeriod timePeriod() { * @return the BudgetInner object itself. */ public BudgetInner withTimePeriod(BudgetTimePeriod timePeriod) { - this.timePeriod = timePeriod; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withTimePeriod(timePeriod); return this; } @@ -183,7 +175,7 @@ public BudgetInner withTimePeriod(BudgetTimePeriod timePeriod) { * @return the filter value. */ public BudgetFilter filter() { - return this.filter; + return this.innerProperties() == null ? null : this.innerProperties().filter(); } /** @@ -193,7 +185,10 @@ public BudgetFilter filter() { * @return the BudgetInner object itself. */ public BudgetInner withFilter(BudgetFilter filter) { - this.filter = filter; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withFilter(filter); return this; } @@ -203,7 +198,7 @@ public BudgetInner withFilter(BudgetFilter filter) { * @return the currentSpend value. */ public CurrentSpend currentSpend() { - return this.currentSpend; + return this.innerProperties() == null ? null : this.innerProperties().currentSpend(); } /** @@ -213,7 +208,7 @@ public CurrentSpend currentSpend() { * @return the notifications value. */ public Map notifications() { - return this.notifications; + return this.innerProperties() == null ? null : this.innerProperties().notifications(); } /** @@ -224,7 +219,10 @@ public Map notifications() { * @return the BudgetInner object itself. */ public BudgetInner withNotifications(Map notifications) { - this.notifications = notifications; + if (this.innerProperties() == null) { + this.innerProperties = new BudgetProperties(); + } + this.innerProperties().withNotifications(notifications); return this; } @@ -234,29 +232,7 @@ public BudgetInner withNotifications(Map notifications) { * @return the forecastSpend value. */ public ForecastSpend forecastSpend() { - return this.forecastSpend; - } - - /** - * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @param etag the etag value to set. - * @return the BudgetInner object itself. - */ - public BudgetInner withEtag(String etag) { - this.etag = etag; - return this; + return this.innerProperties() == null ? null : this.innerProperties().forecastSpend(); } /** @@ -265,27 +241,8 @@ public BudgetInner withEtag(String etag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (timePeriod() != null) { - timePeriod().validate(); - } - if (filter() != null) { - filter().validate(); - } - if (currentSpend() != null) { - currentSpend().validate(); - } - if (notifications() != null) { - notifications() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - if (forecastSpend() != null) { - forecastSpend().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java new file mode 100644 index 000000000000..ef8131acd287 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.BudgetFilter; +import com.azure.resourcemanager.consumption.models.BudgetTimePeriod; +import com.azure.resourcemanager.consumption.models.CategoryType; +import com.azure.resourcemanager.consumption.models.CurrentSpend; +import com.azure.resourcemanager.consumption.models.ForecastSpend; +import com.azure.resourcemanager.consumption.models.Notification; +import com.azure.resourcemanager.consumption.models.TimeGrainType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.util.Map; + +/** The properties of the budget. */ +@Fluent +public final class BudgetProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetProperties.class); + + /* + * The category of the budget, whether the budget tracks cost or usage. + */ + @JsonProperty(value = "category", required = true) + private CategoryType category; + + /* + * The total amount of cost to track with the budget + */ + @JsonProperty(value = "amount", required = true) + private BigDecimal amount; + + /* + * The time covered by a budget. Tracking of the amount will be reset based + * on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are + * only supported by WD customers + */ + @JsonProperty(value = "timeGrain", required = true) + private TimeGrainType timeGrain; + + /* + * Has start and end date of the budget. The start date must be first of + * the month and should be less than the end date. Budget start date must + * be on or after June 1, 2017. Future start date should not be more than + * twelve months. Past start date should be selected within the timegrain + * period. There are no restrictions on the end date. + */ + @JsonProperty(value = "timePeriod", required = true) + private BudgetTimePeriod timePeriod; + + /* + * May be used to filter budgets by user-specified dimensions and/or tags. + */ + @JsonProperty(value = "filter") + private BudgetFilter filter; + + /* + * The current amount of cost which is being tracked for a budget. + */ + @JsonProperty(value = "currentSpend", access = JsonProperty.Access.WRITE_ONLY) + private CurrentSpend currentSpend; + + /* + * Dictionary of notifications associated with the budget. Budget can have + * up to five notifications. + */ + @JsonProperty(value = "notifications") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map notifications; + + /* + * The forecasted cost which is being tracked for a budget. + */ + @JsonProperty(value = "forecastSpend", access = JsonProperty.Access.WRITE_ONLY) + private ForecastSpend forecastSpend; + + /** + * Get the category property: The category of the budget, whether the budget tracks cost or usage. + * + * @return the category value. + */ + public CategoryType category() { + return this.category; + } + + /** + * Set the category property: The category of the budget, whether the budget tracks cost or usage. + * + * @param category the category value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withCategory(CategoryType category) { + this.category = category; + return this; + } + + /** + * Get the amount property: The total amount of cost to track with the budget. + * + * @return the amount value. + */ + public BigDecimal amount() { + return this.amount; + } + + /** + * Set the amount property: The total amount of cost to track with the budget. + * + * @param amount the amount value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withAmount(BigDecimal amount) { + this.amount = amount; + return this; + } + + /** + * Get the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. + * + * @return the timeGrain value. + */ + public TimeGrainType timeGrain() { + return this.timeGrain; + } + + /** + * Set the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time + * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. + * + * @param timeGrain the timeGrain value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withTimeGrain(TimeGrainType timeGrain) { + this.timeGrain = timeGrain; + return this; + } + + /** + * Get the timePeriod property: Has start and end date of the budget. The start date must be first of the month and + * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should + * not be more than twelve months. Past start date should be selected within the timegrain period. There are no + * restrictions on the end date. + * + * @return the timePeriod value. + */ + public BudgetTimePeriod timePeriod() { + return this.timePeriod; + } + + /** + * Set the timePeriod property: Has start and end date of the budget. The start date must be first of the month and + * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should + * not be more than twelve months. Past start date should be selected within the timegrain period. There are no + * restrictions on the end date. + * + * @param timePeriod the timePeriod value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withTimePeriod(BudgetTimePeriod timePeriod) { + this.timePeriod = timePeriod; + return this; + } + + /** + * Get the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * @return the filter value. + */ + public BudgetFilter filter() { + return this.filter; + } + + /** + * Set the filter property: May be used to filter budgets by user-specified dimensions and/or tags. + * + * @param filter the filter value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withFilter(BudgetFilter filter) { + this.filter = filter; + return this; + } + + /** + * Get the currentSpend property: The current amount of cost which is being tracked for a budget. + * + * @return the currentSpend value. + */ + public CurrentSpend currentSpend() { + return this.currentSpend; + } + + /** + * Get the notifications property: Dictionary of notifications associated with the budget. Budget can have up to + * five notifications. + * + * @return the notifications value. + */ + public Map notifications() { + return this.notifications; + } + + /** + * Set the notifications property: Dictionary of notifications associated with the budget. Budget can have up to + * five notifications. + * + * @param notifications the notifications value to set. + * @return the BudgetProperties object itself. + */ + public BudgetProperties withNotifications(Map notifications) { + this.notifications = notifications; + return this; + } + + /** + * Get the forecastSpend property: The forecasted cost which is being tracked for a budget. + * + * @return the forecastSpend value. + */ + public ForecastSpend forecastSpend() { + return this.forecastSpend; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (category() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property category in model BudgetProperties")); + } + if (amount() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property amount in model BudgetProperties")); + } + if (timeGrain() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property timeGrain in model BudgetProperties")); + } + if (timePeriod() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException("Missing required property timePeriod in model BudgetProperties")); + } else { + timePeriod().validate(); + } + if (filter() != null) { + filter().validate(); + } + if (currentSpend() != null) { + currentSpend().validate(); + } + if (notifications() != null) { + notifications() + .values() + .forEach( + e -> { + if (e != null) { + e.validate(); + } + }); + } + if (forecastSpend() != null) { + forecastSpend().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java index c97cdbff92b4..0ee648db2f11 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java @@ -4,67 +4,30 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.Reseller; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** A credit summary resource. */ -@JsonFlatten -@Immutable -public class CreditSummaryInner extends ProxyResource { +@Fluent +public final class CreditSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryInner.class); /* - * Credit Currency + * The properties of the credit summary. */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; + @JsonProperty(value = "properties") + private CreditSummaryProperties innerProperties; /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Summary of balances associated with this credit summary. - */ - @JsonProperty(value = "properties.balanceSummary", access = JsonProperty.Access.WRITE_ONLY) - private CreditBalanceSummary balanceSummary; - - /* - * Pending credit adjustments. - */ - @JsonProperty(value = "properties.pendingCreditAdjustments", access = JsonProperty.Access.WRITE_ONLY) - private Amount pendingCreditAdjustments; - - /* - * Expired credit. - */ - @JsonProperty(value = "properties.expiredCredit", access = JsonProperty.Access.WRITE_ONLY) - private Amount expiredCredit; - - /* - * Pending eligible charges. - */ - @JsonProperty(value = "properties.pendingEligibleCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount pendingEligibleCharges; - - /* - * Reseller details. - */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; - - /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -73,24 +36,34 @@ public class CreditSummaryInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the creditCurrency property: Credit Currency. + * Get the innerProperties property: The properties of the credit summary. * - * @return the creditCurrency value. + * @return the innerProperties value. */ - public String creditCurrency() { - return this.creditCurrency; + private CreditSummaryProperties innerProperties() { + return this.innerProperties; } /** - * Get the billingCurrency property: Billing Currency. + * Get the etag property: The etag for the resource. * - * @return the billingCurrency value. + * @return the etag value. */ - public String billingCurrency() { - return this.billingCurrency; + public String etag() { + return this.etag; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; } /** @@ -99,7 +72,7 @@ public String billingCurrency() { * @return the balanceSummary value. */ public CreditBalanceSummary balanceSummary() { - return this.balanceSummary; + return this.innerProperties() == null ? null : this.innerProperties().balanceSummary(); } /** @@ -108,7 +81,7 @@ public CreditBalanceSummary balanceSummary() { * @return the pendingCreditAdjustments value. */ public Amount pendingCreditAdjustments() { - return this.pendingCreditAdjustments; + return this.innerProperties() == null ? null : this.innerProperties().pendingCreditAdjustments(); } /** @@ -117,7 +90,7 @@ public Amount pendingCreditAdjustments() { * @return the expiredCredit value. */ public Amount expiredCredit() { - return this.expiredCredit; + return this.innerProperties() == null ? null : this.innerProperties().expiredCredit(); } /** @@ -126,34 +99,43 @@ public Amount expiredCredit() { * @return the pendingEligibleCharges value. */ public Amount pendingEligibleCharges() { - return this.pendingEligibleCharges; + return this.innerProperties() == null ? null : this.innerProperties().pendingEligibleCharges(); } /** - * Get the reseller property: Reseller details. + * Get the creditCurrency property: The credit currency. * - * @return the reseller value. + * @return the creditCurrency value. */ - public Reseller reseller() { - return this.reseller; + public String creditCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().creditCurrency(); } /** - * Get the etag property: Resource etag. + * Get the billingCurrency property: The billing currency. * - * @return the etag value. + * @return the billingCurrency value. */ - public String etag() { - return this.etag; + public String billingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); } /** - * Get the tags property: Resource tags. + * Get the reseller property: Credit's reseller. * - * @return the tags value. + * @return the reseller value. */ - public Map tags() { - return this.tags; + public Reseller reseller() { + return this.innerProperties() == null ? null : this.innerProperties().reseller(); + } + + /** + * Get the etag property: The eTag for the resource. + * + * @return the etag value. + */ + public String etagPropertiesEtag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); } /** @@ -162,20 +144,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (balanceSummary() != null) { - balanceSummary().validate(); - } - if (pendingCreditAdjustments() != null) { - pendingCreditAdjustments().validate(); - } - if (expiredCredit() != null) { - expiredCredit().validate(); - } - if (pendingEligibleCharges() != null) { - pendingEligibleCharges().validate(); - } - if (reseller() != null) { - reseller().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java new file mode 100644 index 000000000000..cbe557ebe2bb --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Amount; +import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; +import com.azure.resourcemanager.consumption.models.Reseller; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the credit summary. */ +@Immutable +public final class CreditSummaryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryProperties.class); + + /* + * Summary of balances associated with this credit summary. + */ + @JsonProperty(value = "balanceSummary", access = JsonProperty.Access.WRITE_ONLY) + private CreditBalanceSummary balanceSummary; + + /* + * Pending credit adjustments. + */ + @JsonProperty(value = "pendingCreditAdjustments", access = JsonProperty.Access.WRITE_ONLY) + private Amount pendingCreditAdjustments; + + /* + * Expired credit. + */ + @JsonProperty(value = "expiredCredit", access = JsonProperty.Access.WRITE_ONLY) + private Amount expiredCredit; + + /* + * Pending eligible charges. + */ + @JsonProperty(value = "pendingEligibleCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount pendingEligibleCharges; + + /* + * The credit currency. + */ + @JsonProperty(value = "creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; + + /* + * The billing currency. + */ + @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * Credit's reseller. + */ + @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; + + /* + * The eTag for the resource. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the balanceSummary property: Summary of balances associated with this credit summary. + * + * @return the balanceSummary value. + */ + public CreditBalanceSummary balanceSummary() { + return this.balanceSummary; + } + + /** + * Get the pendingCreditAdjustments property: Pending credit adjustments. + * + * @return the pendingCreditAdjustments value. + */ + public Amount pendingCreditAdjustments() { + return this.pendingCreditAdjustments; + } + + /** + * Get the expiredCredit property: Expired credit. + * + * @return the expiredCredit value. + */ + public Amount expiredCredit() { + return this.expiredCredit; + } + + /** + * Get the pendingEligibleCharges property: Pending eligible charges. + * + * @return the pendingEligibleCharges value. + */ + public Amount pendingEligibleCharges() { + return this.pendingEligibleCharges; + } + + /** + * Get the creditCurrency property: The credit currency. + * + * @return the creditCurrency value. + */ + public String creditCurrency() { + return this.creditCurrency; + } + + /** + * Get the billingCurrency property: The billing currency. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.billingCurrency; + } + + /** + * Get the reseller property: Credit's reseller. + * + * @return the reseller value. + */ + public Reseller reseller() { + return this.reseller; + } + + /** + * Get the etag property: The eTag for the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (balanceSummary() != null) { + balanceSummary().validate(); + } + if (pendingCreditAdjustments() != null) { + pendingCreditAdjustments().validate(); + } + if (expiredCredit() != null) { + expiredCredit().validate(); + } + if (pendingEligibleCharges() != null) { + pendingEligibleCharges().validate(); + } + if (reseller() != null) { + reseller().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java new file mode 100644 index 000000000000..c431a1c9e2bf --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Amount; +import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; +import com.azure.resourcemanager.consumption.models.EventType; +import com.azure.resourcemanager.consumption.models.Reseller; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The event properties. */ +@Fluent +public final class EventProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EventProperties.class); + + /* + * The date of the event. + */ + @JsonProperty(value = "transactionDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime transactionDate; + + /* + * The description of the event. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The amount of new credit or commitment for NewCredit or SettleCharges + * event. + */ + @JsonProperty(value = "newCredit", access = JsonProperty.Access.WRITE_ONLY) + private Amount newCredit; + + /* + * The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. + */ + @JsonProperty(value = "adjustments", access = JsonProperty.Access.WRITE_ONLY) + private Amount adjustments; + + /* + * The amount of expired credit or commitment for NewCredit or + * SettleCharges event. + */ + @JsonProperty(value = "creditExpired", access = JsonProperty.Access.WRITE_ONLY) + private Amount creditExpired; + + /* + * The amount of charges for events of type SettleCharges and + * PendingEligibleCharges. + */ + @JsonProperty(value = "charges", access = JsonProperty.Access.WRITE_ONLY) + private Amount charges; + + /* + * The balance after the event. + */ + @JsonProperty(value = "closedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Amount closedBalance; + + /* + * Identifies the type of the event. + */ + @JsonProperty(value = "eventType") + private EventType eventType; + + /* + * The number which uniquely identifies the invoice on which the event was + * billed. This will be empty for unbilled events. + */ + @JsonProperty(value = "invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceNumber; + + /* + * The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type + * MicrosoftCustomerAgreement. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * The display name of the billing profile for which the event happened. + * The property is only available for billing account of type + * MicrosoftCustomerAgreement. + */ + @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; + + /* + * The ID that uniquely identifies the lot for which the event happened. + */ + @JsonProperty(value = "lotId", access = JsonProperty.Access.WRITE_ONLY) + private String lotId; + + /* + * Identifies the source of the lot for which the event happened. + */ + @JsonProperty(value = "lotSource", access = JsonProperty.Access.WRITE_ONLY) + private String lotSource; + + /* + * Amount of canceled credit. + */ + @JsonProperty(value = "canceledCredit", access = JsonProperty.Access.WRITE_ONLY) + private Amount canceledCredit; + + /* + * The credit currency of the event. + */ + @JsonProperty(value = "creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; + + /* + * The billing currency of the event. + */ + @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * The reseller of the event. + */ + @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; + + /* + * The amount of expired credit or commitment for NewCredit or + * SettleCharges event in billing currency. + */ + @JsonProperty(value = "creditExpiredInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate creditExpiredInBillingCurrency; + + /* + * The amount of new credit or commitment for NewCredit or SettleCharges + * event in billing currency. + */ + @JsonProperty(value = "newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate newCreditInBillingCurrency; + + /* + * The amount of balance adjustment in billing currency. + */ + @JsonProperty(value = "adjustmentsInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate adjustmentsInBillingCurrency; + + /* + * The amount of charges for events of type SettleCharges and + * PendingEligibleCharges in billing currency. + */ + @JsonProperty(value = "chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate chargesInBillingCurrency; + + /* + * The balance in billing currency after the event. + */ + @JsonProperty(value = "closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate closedBalanceInBillingCurrency; + + /* + * The eTag for the resource. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the transactionDate property: The date of the event. + * + * @return the transactionDate value. + */ + public OffsetDateTime transactionDate() { + return this.transactionDate; + } + + /** + * Get the description property: The description of the event. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. + * + * @return the newCredit value. + */ + public Amount newCredit() { + return this.newCredit; + } + + /** + * Get the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. + * + * @return the adjustments value. + */ + public Amount adjustments() { + return this.adjustments; + } + + /** + * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. + * + * @return the creditExpired value. + */ + public Amount creditExpired() { + return this.creditExpired; + } + + /** + * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. + * + * @return the charges value. + */ + public Amount charges() { + return this.charges; + } + + /** + * Get the closedBalance property: The balance after the event. + * + * @return the closedBalance value. + */ + public Amount closedBalance() { + return this.closedBalance; + } + + /** + * Get the eventType property: Identifies the type of the event. + * + * @return the eventType value. + */ + public EventType eventType() { + return this.eventType; + } + + /** + * Set the eventType property: Identifies the type of the event. + * + * @param eventType the eventType value to set. + * @return the EventProperties object itself. + */ + public EventProperties withEventType(EventType eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. + * This will be empty for unbilled events. + * + * @return the invoiceNumber value. + */ + public String invoiceNumber() { + return this.invoiceNumber; + } + + /** + * Get the billingProfileId property: The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileDisplayName property: The display name of the billing profile for which the event happened. + * The property is only available for billing account of type MicrosoftCustomerAgreement. + * + * @return the billingProfileDisplayName value. + */ + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; + } + + /** + * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. + * + * @return the lotId value. + */ + public String lotId() { + return this.lotId; + } + + /** + * Get the lotSource property: Identifies the source of the lot for which the event happened. + * + * @return the lotSource value. + */ + public String lotSource() { + return this.lotSource; + } + + /** + * Get the canceledCredit property: Amount of canceled credit. + * + * @return the canceledCredit value. + */ + public Amount canceledCredit() { + return this.canceledCredit; + } + + /** + * Get the creditCurrency property: The credit currency of the event. + * + * @return the creditCurrency value. + */ + public String creditCurrency() { + return this.creditCurrency; + } + + /** + * Get the billingCurrency property: The billing currency of the event. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.billingCurrency; + } + + /** + * Get the reseller property: The reseller of the event. + * + * @return the reseller value. + */ + public Reseller reseller() { + return this.reseller; + } + + /** + * Get the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or + * SettleCharges event in billing currency. + * + * @return the creditExpiredInBillingCurrency value. + */ + public AmountWithExchangeRate creditExpiredInBillingCurrency() { + return this.creditExpiredInBillingCurrency; + } + + /** + * Get the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or + * SettleCharges event in billing currency. + * + * @return the newCreditInBillingCurrency value. + */ + public AmountWithExchangeRate newCreditInBillingCurrency() { + return this.newCreditInBillingCurrency; + } + + /** + * Get the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. + * + * @return the adjustmentsInBillingCurrency value. + */ + public AmountWithExchangeRate adjustmentsInBillingCurrency() { + return this.adjustmentsInBillingCurrency; + } + + /** + * Get the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and + * PendingEligibleCharges in billing currency. + * + * @return the chargesInBillingCurrency value. + */ + public AmountWithExchangeRate chargesInBillingCurrency() { + return this.chargesInBillingCurrency; + } + + /** + * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event. + * + * @return the closedBalanceInBillingCurrency value. + */ + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.closedBalanceInBillingCurrency; + } + + /** + * Get the etag property: The eTag for the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (newCredit() != null) { + newCredit().validate(); + } + if (adjustments() != null) { + adjustments().validate(); + } + if (creditExpired() != null) { + creditExpired().validate(); + } + if (charges() != null) { + charges().validate(); + } + if (closedBalance() != null) { + closedBalance().validate(); + } + if (canceledCredit() != null) { + canceledCredit().validate(); + } + if (reseller() != null) { + reseller().validate(); + } + if (creditExpiredInBillingCurrency() != null) { + creditExpiredInBillingCurrency().validate(); + } + if (newCreditInBillingCurrency() != null) { + newCreditInBillingCurrency().validate(); + } + if (adjustmentsInBillingCurrency() != null) { + adjustmentsInBillingCurrency().validate(); + } + if (chargesInBillingCurrency() != null) { + chargesInBillingCurrency().validate(); + } + if (closedBalanceInBillingCurrency() != null) { + closedBalanceInBillingCurrency().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java index 61d57e52f495..92aac96d2fbe 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; @@ -13,310 +12,288 @@ import com.azure.resourcemanager.consumption.models.EventType; import com.azure.resourcemanager.consumption.models.Reseller; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** An event summary resource. */ -@JsonFlatten @Fluent -public class EventSummaryInner extends ProxyResource { +public final class EventSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSummaryInner.class); /* - * Credit Currency + * The event properties. */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; + @JsonProperty(value = "properties") + private EventProperties innerProperties; /* - * Billing Currency. + * The etag for the resource. */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Transaction date. - */ - @JsonProperty(value = "properties.transactionDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime transactionDate; - - /* - * Transaction description. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * New Credit. - */ - @JsonProperty(value = "properties.newCredit", access = JsonProperty.Access.WRITE_ONLY) - private Amount newCredit; - - /* - * Current balance. - */ - @JsonProperty(value = "properties.newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate newCreditInBillingCurrency; - - /* - * Adjustments amount. - */ - @JsonProperty(value = "properties.adjustments", access = JsonProperty.Access.WRITE_ONLY) - private Amount adjustments; - - /* - * Current balance. - */ - @JsonProperty(value = "properties.adjustmentsInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate adjustmentsInBillingCurrency; - - /* - * Credit expired. - */ - @JsonProperty(value = "properties.creditExpired", access = JsonProperty.Access.WRITE_ONLY) - private Amount creditExpired; - - /* - * Current balance. - */ - @JsonProperty(value = "properties.creditExpiredInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate creditExpiredInBillingCurrency; - - /* - * Charges amount. - */ - @JsonProperty(value = "properties.charges", access = JsonProperty.Access.WRITE_ONLY) - private Amount charges; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * Current balance. + * Resource tags. */ - @JsonProperty(value = "properties.chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate chargesInBillingCurrency; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * Closed balance. + /** + * Get the innerProperties property: The event properties. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) - private Amount closedBalance; + private EventProperties innerProperties() { + return this.innerProperties; + } - /* - * Current balance. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate closedBalanceInBillingCurrency; + public String etag() { + return this.etag; + } - /* - * The type of event. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "properties.eventType") - private EventType eventType; + public Map tags() { + return this.tags; + } - /* - * Invoice number. + /** + * Get the transactionDate property: The date of the event. + * + * @return the transactionDate value. */ - @JsonProperty(value = "properties.invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceNumber; + public OffsetDateTime transactionDate() { + return this.innerProperties() == null ? null : this.innerProperties().transactionDate(); + } - /* - * Reseller details. + /** + * Get the description property: The description of the event. + * + * @return the description value. */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } - /* - * Resource etag. + /** + * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. + * + * @return the newCredit value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public Amount newCredit() { + return this.innerProperties() == null ? null : this.innerProperties().newCredit(); + } - /* - * Resource tags. + /** + * Get the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. + * + * @return the adjustments value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Amount adjustments() { + return this.innerProperties() == null ? null : this.innerProperties().adjustments(); + } /** - * Get the creditCurrency property: Credit Currency. + * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * - * @return the creditCurrency value. + * @return the creditExpired value. */ - public String creditCurrency() { - return this.creditCurrency; + public Amount creditExpired() { + return this.innerProperties() == null ? null : this.innerProperties().creditExpired(); } /** - * Get the billingCurrency property: Billing Currency. + * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * - * @return the billingCurrency value. + * @return the charges value. */ - public String billingCurrency() { - return this.billingCurrency; + public Amount charges() { + return this.innerProperties() == null ? null : this.innerProperties().charges(); } /** - * Get the transactionDate property: Transaction date. + * Get the closedBalance property: The balance after the event. * - * @return the transactionDate value. + * @return the closedBalance value. */ - public OffsetDateTime transactionDate() { - return this.transactionDate; + public Amount closedBalance() { + return this.innerProperties() == null ? null : this.innerProperties().closedBalance(); } /** - * Get the description property: Transaction description. + * Get the eventType property: Identifies the type of the event. * - * @return the description value. + * @return the eventType value. */ - public String description() { - return this.description; + public EventType eventType() { + return this.innerProperties() == null ? null : this.innerProperties().eventType(); } /** - * Get the newCredit property: New Credit. + * Set the eventType property: Identifies the type of the event. * - * @return the newCredit value. + * @param eventType the eventType value to set. + * @return the EventSummaryInner object itself. */ - public Amount newCredit() { - return this.newCredit; + public EventSummaryInner withEventType(EventType eventType) { + if (this.innerProperties() == null) { + this.innerProperties = new EventProperties(); + } + this.innerProperties().withEventType(eventType); + return this; } /** - * Get the newCreditInBillingCurrency property: Current balance. + * Get the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. + * This will be empty for unbilled events. * - * @return the newCreditInBillingCurrency value. + * @return the invoiceNumber value. */ - public AmountWithExchangeRate newCreditInBillingCurrency() { - return this.newCreditInBillingCurrency; + public String invoiceNumber() { + return this.innerProperties() == null ? null : this.innerProperties().invoiceNumber(); } /** - * Get the adjustments property: Adjustments amount. + * Get the billingProfileId property: The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the adjustments value. + * @return the billingProfileId value. */ - public Amount adjustments() { - return this.adjustments; + public String billingProfileId() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** - * Get the adjustmentsInBillingCurrency property: Current balance. + * Get the billingProfileDisplayName property: The display name of the billing profile for which the event happened. + * The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the adjustmentsInBillingCurrency value. + * @return the billingProfileDisplayName value. */ - public AmountWithExchangeRate adjustmentsInBillingCurrency() { - return this.adjustmentsInBillingCurrency; + public String billingProfileDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingProfileDisplayName(); } /** - * Get the creditExpired property: Credit expired. + * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. * - * @return the creditExpired value. + * @return the lotId value. */ - public Amount creditExpired() { - return this.creditExpired; + public String lotId() { + return this.innerProperties() == null ? null : this.innerProperties().lotId(); } /** - * Get the creditExpiredInBillingCurrency property: Current balance. + * Get the lotSource property: Identifies the source of the lot for which the event happened. * - * @return the creditExpiredInBillingCurrency value. + * @return the lotSource value. */ - public AmountWithExchangeRate creditExpiredInBillingCurrency() { - return this.creditExpiredInBillingCurrency; + public String lotSource() { + return this.innerProperties() == null ? null : this.innerProperties().lotSource(); } /** - * Get the charges property: Charges amount. + * Get the canceledCredit property: Amount of canceled credit. * - * @return the charges value. + * @return the canceledCredit value. */ - public Amount charges() { - return this.charges; + public Amount canceledCredit() { + return this.innerProperties() == null ? null : this.innerProperties().canceledCredit(); } /** - * Get the chargesInBillingCurrency property: Current balance. + * Get the creditCurrency property: The credit currency of the event. * - * @return the chargesInBillingCurrency value. + * @return the creditCurrency value. */ - public AmountWithExchangeRate chargesInBillingCurrency() { - return this.chargesInBillingCurrency; + public String creditCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().creditCurrency(); } /** - * Get the closedBalance property: Closed balance. + * Get the billingCurrency property: The billing currency of the event. * - * @return the closedBalance value. + * @return the billingCurrency value. */ - public Amount closedBalance() { - return this.closedBalance; + public String billingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); } /** - * Get the closedBalanceInBillingCurrency property: Current balance. + * Get the reseller property: The reseller of the event. * - * @return the closedBalanceInBillingCurrency value. + * @return the reseller value. */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; + public Reseller reseller() { + return this.innerProperties() == null ? null : this.innerProperties().reseller(); } /** - * Get the eventType property: The type of event. + * Get the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or + * SettleCharges event in billing currency. * - * @return the eventType value. + * @return the creditExpiredInBillingCurrency value. */ - public EventType eventType() { - return this.eventType; + public AmountWithExchangeRate creditExpiredInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().creditExpiredInBillingCurrency(); } /** - * Set the eventType property: The type of event. + * Get the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or + * SettleCharges event in billing currency. * - * @param eventType the eventType value to set. - * @return the EventSummaryInner object itself. + * @return the newCreditInBillingCurrency value. */ - public EventSummaryInner withEventType(EventType eventType) { - this.eventType = eventType; - return this; + public AmountWithExchangeRate newCreditInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().newCreditInBillingCurrency(); } /** - * Get the invoiceNumber property: Invoice number. + * Get the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. * - * @return the invoiceNumber value. + * @return the adjustmentsInBillingCurrency value. */ - public String invoiceNumber() { - return this.invoiceNumber; + public AmountWithExchangeRate adjustmentsInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().adjustmentsInBillingCurrency(); } /** - * Get the reseller property: Reseller details. + * Get the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and + * PendingEligibleCharges in billing currency. * - * @return the reseller value. + * @return the chargesInBillingCurrency value. */ - public Reseller reseller() { - return this.reseller; + public AmountWithExchangeRate chargesInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().chargesInBillingCurrency(); } /** - * Get the etag property: Resource etag. + * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event. * - * @return the etag value. + * @return the closedBalanceInBillingCurrency value. */ - public String etag() { - return this.etag; + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().closedBalanceInBillingCurrency(); } /** - * Get the tags property: Resource tags. + * Get the etag property: The eTag for the resource. * - * @return the tags value. + * @return the etag value. */ - public Map tags() { - return this.tags; + public String etagPropertiesEtag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); } /** @@ -325,38 +302,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (newCredit() != null) { - newCredit().validate(); - } - if (newCreditInBillingCurrency() != null) { - newCreditInBillingCurrency().validate(); - } - if (adjustments() != null) { - adjustments().validate(); - } - if (adjustmentsInBillingCurrency() != null) { - adjustmentsInBillingCurrency().validate(); - } - if (creditExpired() != null) { - creditExpired().validate(); - } - if (creditExpiredInBillingCurrency() != null) { - creditExpiredInBillingCurrency().validate(); - } - if (charges() != null) { - charges().validate(); - } - if (chargesInBillingCurrency() != null) { - chargesInBillingCurrency().validate(); - } - if (closedBalance() != null) { - closedBalance().validate(); - } - if (closedBalanceInBillingCurrency() != null) { - closedBalanceInBillingCurrency().validate(); - } - if (reseller() != null) { - reseller().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java deleted file mode 100644 index 2815eea54078..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java +++ /dev/null @@ -1,187 +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.consumption.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; -import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.models.ChargeType; -import com.azure.resourcemanager.consumption.models.ForecastPropertiesConfidenceLevelsItem; -import com.azure.resourcemanager.consumption.models.Grain; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** A forecast resource. */ -@JsonFlatten -@Fluent -public class ForecastInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ForecastInner.class); - - /* - * The usage date of the forecast. - */ - @JsonProperty(value = "properties.usageDate", access = JsonProperty.Access.WRITE_ONLY) - private String usageDate; - - /* - * The granularity of forecast. Please note that Yearly is not currently - * supported in this API. The API will provide responses in the Monthly - * grain if Yearly is selected. To get yearly grain data, please use our - * newer Forecast API. - */ - @JsonProperty(value = "properties.grain") - private Grain grain; - - /* - * The amount of charge - */ - @JsonProperty(value = "properties.charge", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal charge; - - /* - * The ISO currency in which the meter is charged, for example, USD. - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * The type of the charge. Could be actual or forecast - */ - @JsonProperty(value = "properties.chargeType") - private ChargeType chargeType; - - /* - * The details about the forecast confidence levels. This is populated only - * when chargeType is Forecast. - */ - @JsonProperty(value = "properties.confidenceLevels", access = JsonProperty.Access.WRITE_ONLY) - private List confidenceLevels; - - /* - * Resource etag. - */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource tags. - */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; - - /** - * Get the usageDate property: The usage date of the forecast. - * - * @return the usageDate value. - */ - public String usageDate() { - return this.usageDate; - } - - /** - * Get the grain property: The granularity of forecast. Please note that Yearly is not currently supported in this - * API. The API will provide responses in the Monthly grain if Yearly is selected. To get yearly grain data, please - * use our newer Forecast API. - * - * @return the grain value. - */ - public Grain grain() { - return this.grain; - } - - /** - * Set the grain property: The granularity of forecast. Please note that Yearly is not currently supported in this - * API. The API will provide responses in the Monthly grain if Yearly is selected. To get yearly grain data, please - * use our newer Forecast API. - * - * @param grain the grain value to set. - * @return the ForecastInner object itself. - */ - public ForecastInner withGrain(Grain grain) { - this.grain = grain; - return this; - } - - /** - * Get the charge property: The amount of charge. - * - * @return the charge value. - */ - public BigDecimal charge() { - return this.charge; - } - - /** - * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * - * @return the currency value. - */ - public String currency() { - return this.currency; - } - - /** - * Get the chargeType property: The type of the charge. Could be actual or forecast. - * - * @return the chargeType value. - */ - public ChargeType chargeType() { - return this.chargeType; - } - - /** - * Set the chargeType property: The type of the charge. Could be actual or forecast. - * - * @param chargeType the chargeType value to set. - * @return the ForecastInner object itself. - */ - public ForecastInner withChargeType(ChargeType chargeType) { - this.chargeType = chargeType; - return this; - } - - /** - * Get the confidenceLevels property: The details about the forecast confidence levels. This is populated only when - * chargeType is Forecast. - * - * @return the confidenceLevels value. - */ - public List confidenceLevels() { - return this.confidenceLevels; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (confidenceLevels() != null) { - confidenceLevels().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java new file mode 100644 index 000000000000..935660710f20 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; + +/** The properties of legacy charge summary. */ +@Immutable +public final class LegacyChargeSummaryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummaryProperties.class); + + /* + * The id of the billing period resource that the charge belongs to. + */ + @JsonProperty(value = "billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) + private String billingPeriodId; + + /* + * Usage start date. + */ + @JsonProperty(value = "usageStart", access = JsonProperty.Access.WRITE_ONLY) + private String usageStart; + + /* + * Usage end date. + */ + @JsonProperty(value = "usageEnd", access = JsonProperty.Access.WRITE_ONLY) + private String usageEnd; + + /* + * Azure Charges. + */ + @JsonProperty(value = "azureCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal azureCharges; + + /* + * Charges Billed separately. + */ + @JsonProperty(value = "chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal chargesBilledSeparately; + + /* + * Marketplace Charges. + */ + @JsonProperty(value = "marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal marketplaceCharges; + + /* + * Currency Code + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /** + * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. + * + * @return the billingPeriodId value. + */ + public String billingPeriodId() { + return this.billingPeriodId; + } + + /** + * Get the usageStart property: Usage start date. + * + * @return the usageStart value. + */ + public String usageStart() { + return this.usageStart; + } + + /** + * Get the usageEnd property: Usage end date. + * + * @return the usageEnd value. + */ + public String usageEnd() { + return this.usageEnd; + } + + /** + * Get the azureCharges property: Azure Charges. + * + * @return the azureCharges value. + */ + public BigDecimal azureCharges() { + return this.azureCharges; + } + + /** + * Get the chargesBilledSeparately property: Charges Billed separately. + * + * @return the chargesBilledSeparately value. + */ + public BigDecimal chargesBilledSeparately() { + return this.chargesBilledSeparately; + } + + /** + * Get the marketplaceCharges property: Marketplace Charges. + * + * @return the marketplaceCharges value. + */ + public BigDecimal marketplaceCharges() { + return this.marketplaceCharges; + } + + /** + * Get the currency property: Currency Code. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java new file mode 100644 index 000000000000..e2ac9f729a0c --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.SkuProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** The properties of the reservation recommendation. */ +@Immutable +public final class LegacyReservationRecommendationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendationProperties.class); + + /* + * The number of days of usage to look back for recommendation. + */ + @JsonProperty(value = "lookBackPeriod", access = JsonProperty.Access.WRITE_ONLY) + private String lookBackPeriod; + + /* + * The instance Flexibility Ratio. + */ + @JsonProperty(value = "instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) + private Float instanceFlexibilityRatio; + + /* + * The instance Flexibility Group. + */ + @JsonProperty(value = "instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) + private String instanceFlexibilityGroup; + + /* + * The normalized Size. + */ + @JsonProperty(value = "normalizedSize", access = JsonProperty.Access.WRITE_ONLY) + private String normalizedSize; + + /* + * The recommended Quantity Normalized. + */ + @JsonProperty(value = "recommendedQuantityNormalized", access = JsonProperty.Access.WRITE_ONLY) + private Float recommendedQuantityNormalized; + + /* + * The meter id (GUID) + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private UUID meterId; + + /* + * The azure resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + + /* + * RI recommendations in one or three year terms. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * The total amount of cost without reserved instances. + */ + @JsonProperty(value = "costWithNoReservedInstances", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal costWithNoReservedInstances; + + /* + * Recommended quality for reserved instances. + */ + @JsonProperty(value = "recommendedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal recommendedQuantity; + + /* + * The total amount of cost with reserved instances. + */ + @JsonProperty(value = "totalCostWithReservedInstances", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal totalCostWithReservedInstances; + + /* + * Total estimated savings with reserved instances. + */ + @JsonProperty(value = "netSavings", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal netSavings; + + /* + * The usage date for looking back. + */ + @JsonProperty(value = "firstUsageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstUsageDate; + + /* + * Shared or single recommendation. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * List of sku properties + */ + @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY) + private List skuProperties; + + /** + * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. + * + * @return the lookBackPeriod value. + */ + public String lookBackPeriod() { + return this.lookBackPeriod; + } + + /** + * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. + * + * @return the instanceFlexibilityRatio value. + */ + public Float instanceFlexibilityRatio() { + return this.instanceFlexibilityRatio; + } + + /** + * Get the instanceFlexibilityGroup property: The instance Flexibility Group. + * + * @return the instanceFlexibilityGroup value. + */ + public String instanceFlexibilityGroup() { + return this.instanceFlexibilityGroup; + } + + /** + * Get the normalizedSize property: The normalized Size. + * + * @return the normalizedSize value. + */ + public String normalizedSize() { + return this.normalizedSize; + } + + /** + * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. + * + * @return the recommendedQuantityNormalized value. + */ + public Float recommendedQuantityNormalized() { + return this.recommendedQuantityNormalized; + } + + /** + * Get the meterId property: The meter id (GUID). + * + * @return the meterId value. + */ + public UUID meterId() { + return this.meterId; + } + + /** + * Get the resourceType property: The azure resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + + /** + * Get the term property: RI recommendations in one or three year terms. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. + * + * @return the costWithNoReservedInstances value. + */ + public BigDecimal costWithNoReservedInstances() { + return this.costWithNoReservedInstances; + } + + /** + * Get the recommendedQuantity property: Recommended quality for reserved instances. + * + * @return the recommendedQuantity value. + */ + public BigDecimal recommendedQuantity() { + return this.recommendedQuantity; + } + + /** + * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. + * + * @return the totalCostWithReservedInstances value. + */ + public BigDecimal totalCostWithReservedInstances() { + return this.totalCostWithReservedInstances; + } + + /** + * Get the netSavings property: Total estimated savings with reserved instances. + * + * @return the netSavings value. + */ + public BigDecimal netSavings() { + return this.netSavings; + } + + /** + * Get the firstUsageDate property: The usage date for looking back. + * + * @return the firstUsageDate value. + */ + public OffsetDateTime firstUsageDate() { + return this.firstUsageDate; + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the skuProperties property: List of sku properties. + * + * @return the skuProperties value. + */ + public List skuProperties() { + return this.skuProperties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (skuProperties() != null) { + skuProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java new file mode 100644 index 000000000000..779046a2a885 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The properties of a legacy reservation transaction. */ +@Immutable +public final class LegacyReservationTransactionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationTransactionProperties.class); + + /* + * The date of the transaction + */ + @JsonProperty(value = "eventDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime eventDate; + + /* + * The reservation order ID is the identifier for a reservation purchase. + * Each reservation order ID represents a single purchase transaction. A + * reservation order contains reservations. The reservation order specifies + * the VM size and region for the reservations. + */ + @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderId; + + /* + * The description of the transaction. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The type of the transaction (Purchase, Cancel, etc.) + */ + @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) + private String eventType; + + /* + * The quantity of the transaction. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal quantity; + + /* + * The charge of the transaction. + */ + @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal amount; + + /* + * The ISO currency in which the transaction is charged, for example, USD. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * The name of the reservation order. + */ + @JsonProperty(value = "reservationOrderName", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderName; + + /* + * The purchasing enrollment. + */ + @JsonProperty(value = "purchasingEnrollment", access = JsonProperty.Access.WRITE_ONLY) + private String purchasingEnrollment; + + /* + * The subscription guid that makes the transaction. + */ + @JsonProperty(value = "purchasingSubscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) + private UUID purchasingSubscriptionGuid; + + /* + * The subscription name that makes the transaction. + */ + @JsonProperty(value = "purchasingSubscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String purchasingSubscriptionName; + + /* + * This is the ARM Sku name. It can be used to join with the serviceType + * field in additional info in usage records. + */ + @JsonProperty(value = "armSkuName", access = JsonProperty.Access.WRITE_ONLY) + private String armSkuName; + + /* + * This is the term of the transaction. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * The region of the transaction. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The name of the account that makes the transaction. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /* + * The email of the account owner that makes the transaction. + */ + @JsonProperty(value = "accountOwnerEmail", access = JsonProperty.Access.WRITE_ONLY) + private String accountOwnerEmail; + + /* + * The department name. + */ + @JsonProperty(value = "departmentName", access = JsonProperty.Access.WRITE_ONLY) + private String departmentName; + + /* + * The cost center of this department if it is a department and a cost + * center is provided. + */ + @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) + private String costCenter; + + /* + * The current enrollment. + */ + @JsonProperty(value = "currentEnrollment", access = JsonProperty.Access.WRITE_ONLY) + private String currentEnrollment; + + /* + * The billing frequency, which can be either one-time or recurring. + */ + @JsonProperty(value = "billingFrequency", access = JsonProperty.Access.WRITE_ONLY) + private String billingFrequency; + + /** + * Get the eventDate property: The date of the transaction. + * + * @return the eventDate value. + */ + public OffsetDateTime eventDate() { + return this.eventDate; + } + + /** + * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each + * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The + * reservation order specifies the VM size and region for the reservations. + * + * @return the reservationOrderId value. + */ + public String reservationOrderId() { + return this.reservationOrderId; + } + + /** + * Get the description property: The description of the transaction. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Get the quantity property: The quantity of the transaction. + * + * @return the quantity value. + */ + public BigDecimal quantity() { + return this.quantity; + } + + /** + * Get the amount property: The charge of the transaction. + * + * @return the amount value. + */ + public BigDecimal amount() { + return this.amount; + } + + /** + * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the reservationOrderName property: The name of the reservation order. + * + * @return the reservationOrderName value. + */ + public String reservationOrderName() { + return this.reservationOrderName; + } + + /** + * Get the purchasingEnrollment property: The purchasing enrollment. + * + * @return the purchasingEnrollment value. + */ + public String purchasingEnrollment() { + return this.purchasingEnrollment; + } + + /** + * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. + * + * @return the purchasingSubscriptionGuid value. + */ + public UUID purchasingSubscriptionGuid() { + return this.purchasingSubscriptionGuid; + } + + /** + * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. + * + * @return the purchasingSubscriptionName value. + */ + public String purchasingSubscriptionName() { + return this.purchasingSubscriptionName; + } + + /** + * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in + * additional info in usage records. + * + * @return the armSkuName value. + */ + public String armSkuName() { + return this.armSkuName; + } + + /** + * Get the term property: This is the term of the transaction. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the region property: The region of the transaction. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the accountName property: The name of the account that makes the transaction. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the accountOwnerEmail property: The email of the account owner that makes the transaction. + * + * @return the accountOwnerEmail value. + */ + public String accountOwnerEmail() { + return this.accountOwnerEmail; + } + + /** + * Get the departmentName property: The department name. + * + * @return the departmentName value. + */ + public String departmentName() { + return this.departmentName; + } + + /** + * Get the costCenter property: The cost center of this department if it is a department and a cost center is + * provided. + * + * @return the costCenter value. + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Get the currentEnrollment property: The current enrollment. + * + * @return the currentEnrollment value. + */ + public String currentEnrollment() { + return this.currentEnrollment; + } + + /** + * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. + * + * @return the billingFrequency value. + */ + public String billingFrequency() { + return this.billingFrequency; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java new file mode 100644 index 000000000000..39b1dfa8f812 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java @@ -0,0 +1,726 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.MeterDetailsResponse; +import com.azure.resourcemanager.consumption.models.PricingModelType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The properties of the legacy usage detail. */ +@Immutable +public final class LegacyUsageDetailProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetailProperties.class); + + /* + * Billing Account identifier. + */ + @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /* + * Billing Account Name. + */ + @JsonProperty(value = "billingAccountName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountName; + + /* + * The billing period start date. + */ + @JsonProperty(value = "billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime billingPeriodStartDate; + + /* + * The billing period end date. + */ + @JsonProperty(value = "billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime billingPeriodEndDate; + + /* + * Billing Profile identifier. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * Billing Profile Name. + */ + @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileName; + + /* + * Account Owner Id. + */ + @JsonProperty(value = "accountOwnerId", access = JsonProperty.Access.WRITE_ONLY) + private String accountOwnerId; + + /* + * Account Name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /* + * Subscription guid. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /* + * Subscription name. + */ + @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; + + /* + * Date for the usage record. + */ + @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime date; + + /* + * Product name for the consumed service or purchase. Not available for + * Marketplace. + */ + @JsonProperty(value = "product", access = JsonProperty.Access.WRITE_ONLY) + private String product; + + /* + * Part Number of the service used. Can be used to join with the price + * sheet. Not available for marketplace. + */ + @JsonProperty(value = "partNumber", access = JsonProperty.Access.WRITE_ONLY) + private String partNumber; + + /* + * The meter id (GUID). Not available for marketplace. For reserved + * instance this represents the primary meter for which the reservation was + * purchased. For the actual VM Size for which the reservation is purchased + * see productOrderName. + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private UUID meterId; + + /* + * The details about the meter. By default this is not populated, unless + * it's specified in $expand. + */ + @JsonProperty(value = "meterDetails", access = JsonProperty.Access.WRITE_ONLY) + private MeterDetailsResponse meterDetails; + + /* + * The usage quantity. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal quantity; + + /* + * Effective Price that's charged for the usage. + */ + @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal effectivePrice; + + /* + * The amount of cost before tax. + */ + @JsonProperty(value = "cost", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal cost; + + /* + * Unit Price is the price applicable to you. (your EA or other contract + * price). + */ + @JsonProperty(value = "unitPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal unitPrice; + + /* + * Billing Currency. + */ + @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * Resource Location. + */ + @JsonProperty(value = "resourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocation; + + /* + * Consumed service name. Name of the azure resource provider that emits + * the usage or was purchased. This value is not provided for marketplace + * usage. + */ + @JsonProperty(value = "consumedService", access = JsonProperty.Access.WRITE_ONLY) + private String consumedService; + + /* + * Unique identifier of the Azure Resource Manager usage detail resource. + */ + @JsonProperty(value = "resourceId", access = JsonProperty.Access.WRITE_ONLY) + private String resourceId; + + /* + * Resource Name. + */ + @JsonProperty(value = "resourceName", access = JsonProperty.Access.WRITE_ONLY) + private String resourceName; + + /* + * Service-specific metadata. + */ + @JsonProperty(value = "serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) + private String serviceInfo1; + + /* + * Legacy field with optional service-specific metadata. + */ + @JsonProperty(value = "serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) + private String serviceInfo2; + + /* + * Additional details of this usage item. By default this is not populated, + * unless it's specified in $expand. Use this field to get usage line item + * specific details such as the actual VM Size (ServiceType) or the ratio + * in which the reservation discount is applied. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String additionalInfo; + + /* + * Invoice Section Name. + */ + @JsonProperty(value = "invoiceSection", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSection; + + /* + * The cost center of this department if it is a department and a cost + * center is provided. + */ + @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) + private String costCenter; + + /* + * Resource Group Name. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /* + * ARM resource id of the reservation. Only applies to records relevant to + * reservations. + */ + @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * User provided display name of the reservation. Last known name for a + * particular day is populated in the daily data. Only applies to records + * relevant to reservations. + */ + @JsonProperty(value = "reservationName", access = JsonProperty.Access.WRITE_ONLY) + private String reservationName; + + /* + * Product Order Id. For reservations this is the Reservation Order ID. + */ + @JsonProperty(value = "productOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String productOrderId; + + /* + * Product Order Name. For reservations this is the SKU that was purchased. + */ + @JsonProperty(value = "productOrderName", access = JsonProperty.Access.WRITE_ONLY) + private String productOrderName; + + /* + * Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + */ + @JsonProperty(value = "offerId", access = JsonProperty.Access.WRITE_ONLY) + private String offerId; + + /* + * Is Azure Credit Eligible. + */ + @JsonProperty(value = "isAzureCreditEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAzureCreditEligible; + + /* + * Term (in months). 1 month for monthly recurring purchase. 12 months for + * a 1 year reservation. 36 months for a 3 year reservation. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * Publisher Name. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * Publisher Type. + */ + @JsonProperty(value = "publisherType", access = JsonProperty.Access.WRITE_ONLY) + private String publisherType; + + /* + * Plan Name. + */ + @JsonProperty(value = "planName", access = JsonProperty.Access.WRITE_ONLY) + private String planName; + + /* + * Indicates a charge represents credits, usage, a Marketplace purchase, a + * reservation fee, or a refund. + */ + @JsonProperty(value = "chargeType", access = JsonProperty.Access.WRITE_ONLY) + private String chargeType; + + /* + * Indicates how frequently this charge will occur. OneTime for purchases + * which only happen once, Monthly for fees which recur every month, and + * UsageBased for charges based on how much a service is used. + */ + @JsonProperty(value = "frequency", access = JsonProperty.Access.WRITE_ONLY) + private String frequency; + + /* + * Retail price for the resource. + */ + @JsonProperty(value = "payGPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal payGPrice; + + /* + * Identifier that indicates how the meter is priced. + */ + @JsonProperty(value = "pricingModel", access = JsonProperty.Access.WRITE_ONLY) + private PricingModelType pricingModel; + + /** + * Get the billingAccountId property: Billing Account identifier. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the billingAccountName property: Billing Account Name. + * + * @return the billingAccountName value. + */ + public String billingAccountName() { + return this.billingAccountName; + } + + /** + * Get the billingPeriodStartDate property: The billing period start date. + * + * @return the billingPeriodStartDate value. + */ + public OffsetDateTime billingPeriodStartDate() { + return this.billingPeriodStartDate; + } + + /** + * Get the billingPeriodEndDate property: The billing period end date. + * + * @return the billingPeriodEndDate value. + */ + public OffsetDateTime billingPeriodEndDate() { + return this.billingPeriodEndDate; + } + + /** + * Get the billingProfileId property: Billing Profile identifier. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileName property: Billing Profile Name. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.billingProfileName; + } + + /** + * Get the accountOwnerId property: Account Owner Id. + * + * @return the accountOwnerId value. + */ + public String accountOwnerId() { + return this.accountOwnerId; + } + + /** + * Get the accountName property: Account Name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the subscriptionId property: Subscription guid. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the subscriptionName property: Subscription name. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Get the date property: Date for the usage record. + * + * @return the date value. + */ + public OffsetDateTime date() { + return this.date; + } + + /** + * Get the product property: Product name for the consumed service or purchase. Not available for Marketplace. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Get the partNumber property: Part Number of the service used. Can be used to join with the price sheet. Not + * available for marketplace. + * + * @return the partNumber value. + */ + public String partNumber() { + return this.partNumber; + } + + /** + * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this + * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the + * reservation is purchased see productOrderName. + * + * @return the meterId value. + */ + public UUID meterId() { + return this.meterId; + } + + /** + * Get the meterDetails property: The details about the meter. By default this is not populated, unless it's + * specified in $expand. + * + * @return the meterDetails value. + */ + public MeterDetailsResponse meterDetails() { + return this.meterDetails; + } + + /** + * Get the quantity property: The usage quantity. + * + * @return the quantity value. + */ + public BigDecimal quantity() { + return this.quantity; + } + + /** + * Get the effectivePrice property: Effective Price that's charged for the usage. + * + * @return the effectivePrice value. + */ + public BigDecimal effectivePrice() { + return this.effectivePrice; + } + + /** + * Get the cost property: The amount of cost before tax. + * + * @return the cost value. + */ + public BigDecimal cost() { + return this.cost; + } + + /** + * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). + * + * @return the unitPrice value. + */ + public BigDecimal unitPrice() { + return this.unitPrice; + } + + /** + * Get the billingCurrency property: Billing Currency. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.billingCurrency; + } + + /** + * Get the resourceLocation property: Resource Location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage + * or was purchased. This value is not provided for marketplace usage. + * + * @return the consumedService value. + */ + public String consumedService() { + return this.consumedService; + } + + /** + * Get the resourceId property: Unique identifier of the Azure Resource Manager usage detail resource. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the resourceName property: Resource Name. + * + * @return the resourceName value. + */ + public String resourceName() { + return this.resourceName; + } + + /** + * Get the serviceInfo1 property: Service-specific metadata. + * + * @return the serviceInfo1 value. + */ + public String serviceInfo1() { + return this.serviceInfo1; + } + + /** + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. + * + * @return the serviceInfo2 value. + */ + public String serviceInfo2() { + return this.serviceInfo2; + } + + /** + * Get the additionalInfo property: Additional details of this usage item. By default this is not populated, unless + * it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size + * (ServiceType) or the ratio in which the reservation discount is applied. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * Get the invoiceSection property: Invoice Section Name. + * + * @return the invoiceSection value. + */ + public String invoiceSection() { + return this.invoiceSection; + } + + /** + * Get the costCenter property: The cost center of this department if it is a department and a cost center is + * provided. + * + * @return the costCenter value. + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Get the resourceGroup property: Resource Group Name. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to + * reservations. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the reservationName property: User provided display name of the reservation. Last known name for a particular + * day is populated in the daily data. Only applies to records relevant to reservations. + * + * @return the reservationName value. + */ + public String reservationName() { + return this.reservationName; + } + + /** + * Get the productOrderId property: Product Order Id. For reservations this is the Reservation Order ID. + * + * @return the productOrderId value. + */ + public String productOrderId() { + return this.productOrderId; + } + + /** + * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. + * + * @return the productOrderName value. + */ + public String productOrderName() { + return this.productOrderName; + } + + /** + * Get the offerId property: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. + * + * @return the offerId value. + */ + public String offerId() { + return this.offerId; + } + + /** + * Get the isAzureCreditEligible property: Is Azure Credit Eligible. + * + * @return the isAzureCreditEligible value. + */ + public Boolean isAzureCreditEligible() { + return this.isAzureCreditEligible; + } + + /** + * Get the term property: Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year + * reservation. 36 months for a 3 year reservation. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the publisherName property: Publisher Name. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the publisherType property: Publisher Type. + * + * @return the publisherType value. + */ + public String publisherType() { + return this.publisherType; + } + + /** + * Get the planName property: Plan Name. + * + * @return the planName value. + */ + public String planName() { + return this.planName; + } + + /** + * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation + * fee, or a refund. + * + * @return the chargeType value. + */ + public String chargeType() { + return this.chargeType; + } + + /** + * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only + * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is + * used. + * + * @return the frequency value. + */ + public String frequency() { + return this.frequency; + } + + /** + * Get the payGPrice property: Retail price for the resource. + * + * @return the payGPrice value. + */ + public BigDecimal payGPrice() { + return this.payGPrice; + } + + /** + * Get the pricingModel property: Identifier that indicates how the meter is priced. + * + * @return the pricingModel value. + */ + public PricingModelType pricingModel() { + return this.pricingModel; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (meterDetails() != null) { + meterDetails().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java new file mode 100644 index 000000000000..6849ba86cdac --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Amount; +import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; +import com.azure.resourcemanager.consumption.models.LotSource; +import com.azure.resourcemanager.consumption.models.Reseller; +import com.azure.resourcemanager.consumption.models.Status; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The lot properties. */ +@Immutable +public final class LotProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LotProperties.class); + + /* + * The original amount of a lot. + */ + @JsonProperty(value = "originalAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount originalAmount; + + /* + * The balance as of the last invoice. + */ + @JsonProperty(value = "closedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Amount closedBalance; + + /* + * The source of the lot. + */ + @JsonProperty(value = "source", access = JsonProperty.Access.WRITE_ONLY) + private LotSource source; + + /* + * The date when the lot became effective. + */ + @JsonProperty(value = "startDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime startDate; + + /* + * The expiration date of a lot. + */ + @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime expirationDate; + + /* + * The po number of the invoice on which the lot was added. This property + * is not available for ConsumptionCommitment lots. + */ + @JsonProperty(value = "poNumber", access = JsonProperty.Access.WRITE_ONLY) + private String poNumber; + + /* + * The date when the lot was added. + */ + @JsonProperty(value = "purchasedDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime purchasedDate; + + /* + * The status of the lot. + */ + @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The currency of the lot. + */ + @JsonProperty(value = "creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; + + /* + * The billing currency of the lot. + */ + @JsonProperty(value = "billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * The original amount of a lot in billing currency. + */ + @JsonProperty(value = "originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate originalAmountInBillingCurrency; + + /* + * The balance as of the last invoice in billing currency. + */ + @JsonProperty(value = "closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate closedBalanceInBillingCurrency; + + /* + * The reseller of the lot. + */ + @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) + private Reseller reseller; + + /* + * The eTag for the resource. + */ + @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; + + /** + * Get the originalAmount property: The original amount of a lot. + * + * @return the originalAmount value. + */ + public Amount originalAmount() { + return this.originalAmount; + } + + /** + * Get the closedBalance property: The balance as of the last invoice. + * + * @return the closedBalance value. + */ + public Amount closedBalance() { + return this.closedBalance; + } + + /** + * Get the source property: The source of the lot. + * + * @return the source value. + */ + public LotSource source() { + return this.source; + } + + /** + * Get the startDate property: The date when the lot became effective. + * + * @return the startDate value. + */ + public OffsetDateTime startDate() { + return this.startDate; + } + + /** + * Get the expirationDate property: The expiration date of a lot. + * + * @return the expirationDate value. + */ + public OffsetDateTime expirationDate() { + return this.expirationDate; + } + + /** + * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not + * available for ConsumptionCommitment lots. + * + * @return the poNumber value. + */ + public String poNumber() { + return this.poNumber; + } + + /** + * Get the purchasedDate property: The date when the lot was added. + * + * @return the purchasedDate value. + */ + public OffsetDateTime purchasedDate() { + return this.purchasedDate; + } + + /** + * Get the status property: The status of the lot. + * + * @return the status value. + */ + public Status status() { + return this.status; + } + + /** + * Get the creditCurrency property: The currency of the lot. + * + * @return the creditCurrency value. + */ + public String creditCurrency() { + return this.creditCurrency; + } + + /** + * Get the billingCurrency property: The billing currency of the lot. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.billingCurrency; + } + + /** + * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. + * + * @return the originalAmountInBillingCurrency value. + */ + public AmountWithExchangeRate originalAmountInBillingCurrency() { + return this.originalAmountInBillingCurrency; + } + + /** + * Get the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. + * + * @return the closedBalanceInBillingCurrency value. + */ + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.closedBalanceInBillingCurrency; + } + + /** + * Get the reseller property: The reseller of the lot. + * + * @return the reseller value. + */ + public Reseller reseller() { + return this.reseller; + } + + /** + * Get the etag property: The eTag for the resource. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (originalAmount() != null) { + originalAmount().validate(); + } + if (closedBalance() != null) { + closedBalance().validate(); + } + if (originalAmountInBillingCurrency() != null) { + originalAmountInBillingCurrency().validate(); + } + if (closedBalanceInBillingCurrency() != null) { + closedBalanceInBillingCurrency().validate(); + } + if (reseller() != null) { + reseller().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java index a0ebd141f5a4..e0be0f6c5714 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java @@ -4,93 +4,33 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.Reseller; +import com.azure.resourcemanager.consumption.models.Status; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.Map; /** A lot summary resource. */ -@JsonFlatten -@Immutable -public class LotSummaryInner extends ProxyResource { +@Fluent +public final class LotSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LotSummaryInner.class); /* - * Credit Currency + * The lot properties. */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; + @JsonProperty(value = "properties") + private LotProperties innerProperties; /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Original amount. - */ - @JsonProperty(value = "properties.originalAmount", access = JsonProperty.Access.WRITE_ONLY) - private Amount originalAmount; - - /* - * Current balance. - */ - @JsonProperty(value = "properties.originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate originalAmountInBillingCurrency; - - /* - * Closed balance. - */ - @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) - private Amount closedBalance; - - /* - * Current balance. - */ - @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate closedBalanceInBillingCurrency; - - /* - * Lot source. - */ - @JsonProperty(value = "properties.source", access = JsonProperty.Access.WRITE_ONLY) - private LotSource source; - - /* - * Start date. - */ - @JsonProperty(value = "properties.startDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDate; - - /* - * Expiration date. - */ - @JsonProperty(value = "properties.expirationDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expirationDate; - - /* - * PO number. - */ - @JsonProperty(value = "properties.poNumber", access = JsonProperty.Access.WRITE_ONLY) - private String poNumber; - - /* - * Reseller details. - */ - @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) - private Reseller reseller; - - /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -99,123 +39,161 @@ public class LotSummaryInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the creditCurrency property: Credit Currency. + * Get the innerProperties property: The lot properties. * - * @return the creditCurrency value. + * @return the innerProperties value. */ - public String creditCurrency() { - return this.creditCurrency; + private LotProperties innerProperties() { + return this.innerProperties; } /** - * Get the billingCurrency property: Billing Currency. + * Get the etag property: The etag for the resource. * - * @return the billingCurrency value. + * @return the etag value. */ - public String billingCurrency() { - return this.billingCurrency; + public String etag() { + return this.etag; } /** - * Get the originalAmount property: Original amount. + * Get the tags property: Resource tags. * - * @return the originalAmount value. + * @return the tags value. */ - public Amount originalAmount() { - return this.originalAmount; + public Map tags() { + return this.tags; } /** - * Get the originalAmountInBillingCurrency property: Current balance. + * Get the originalAmount property: The original amount of a lot. * - * @return the originalAmountInBillingCurrency value. + * @return the originalAmount value. */ - public AmountWithExchangeRate originalAmountInBillingCurrency() { - return this.originalAmountInBillingCurrency; + public Amount originalAmount() { + return this.innerProperties() == null ? null : this.innerProperties().originalAmount(); } /** - * Get the closedBalance property: Closed balance. + * Get the closedBalance property: The balance as of the last invoice. * * @return the closedBalance value. */ public Amount closedBalance() { - return this.closedBalance; + return this.innerProperties() == null ? null : this.innerProperties().closedBalance(); } /** - * Get the closedBalanceInBillingCurrency property: Current balance. - * - * @return the closedBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; - } - - /** - * Get the source property: Lot source. + * Get the source property: The source of the lot. * * @return the source value. */ public LotSource source() { - return this.source; + return this.innerProperties() == null ? null : this.innerProperties().source(); } /** - * Get the startDate property: Start date. + * Get the startDate property: The date when the lot became effective. * * @return the startDate value. */ public OffsetDateTime startDate() { - return this.startDate; + return this.innerProperties() == null ? null : this.innerProperties().startDate(); } /** - * Get the expirationDate property: Expiration date. + * Get the expirationDate property: The expiration date of a lot. * * @return the expirationDate value. */ public OffsetDateTime expirationDate() { - return this.expirationDate; + return this.innerProperties() == null ? null : this.innerProperties().expirationDate(); } /** - * Get the poNumber property: PO number. + * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not + * available for ConsumptionCommitment lots. * * @return the poNumber value. */ public String poNumber() { - return this.poNumber; + return this.innerProperties() == null ? null : this.innerProperties().poNumber(); } /** - * Get the reseller property: Reseller details. + * Get the purchasedDate property: The date when the lot was added. * - * @return the reseller value. + * @return the purchasedDate value. */ - public Reseller reseller() { - return this.reseller; + public OffsetDateTime purchasedDate() { + return this.innerProperties() == null ? null : this.innerProperties().purchasedDate(); } /** - * Get the etag property: Resource etag. + * Get the status property: The status of the lot. * - * @return the etag value. + * @return the status value. */ - public String etag() { - return this.etag; + public Status status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); } /** - * Get the tags property: Resource tags. + * Get the creditCurrency property: The currency of the lot. * - * @return the tags value. + * @return the creditCurrency value. */ - public Map tags() { - return this.tags; + public String creditCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().creditCurrency(); + } + + /** + * Get the billingCurrency property: The billing currency of the lot. + * + * @return the billingCurrency value. + */ + public String billingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); + } + + /** + * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. + * + * @return the originalAmountInBillingCurrency value. + */ + public AmountWithExchangeRate originalAmountInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().originalAmountInBillingCurrency(); + } + + /** + * Get the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. + * + * @return the closedBalanceInBillingCurrency value. + */ + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.innerProperties() == null ? null : this.innerProperties().closedBalanceInBillingCurrency(); + } + + /** + * Get the reseller property: The reseller of the lot. + * + * @return the reseller value. + */ + public Reseller reseller() { + return this.innerProperties() == null ? null : this.innerProperties().reseller(); + } + + /** + * Get the etag property: The eTag for the resource. + * + * @return the etag value. + */ + public String etagPropertiesEtag() { + return this.innerProperties() == null ? null : this.innerProperties().etag(); } /** @@ -224,20 +202,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (originalAmount() != null) { - originalAmount().validate(); - } - if (originalAmountInBillingCurrency() != null) { - originalAmountInBillingCurrency().validate(); - } - if (closedBalance() != null) { - closedBalance().validate(); - } - if (closedBalanceInBillingCurrency() != null) { - closedBalanceInBillingCurrency().validate(); - } - if (reseller() != null) { - reseller().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java new file mode 100644 index 000000000000..de916d475acc --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.List; + +/** The properties of the Management Group Aggregated Cost. */ +@Fluent +public final class ManagementGroupAggregatedCostProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupAggregatedCostProperties.class); + + /* + * The id of the billing period resource that the aggregated cost belongs + * to. + */ + @JsonProperty(value = "billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) + private String billingPeriodId; + + /* + * The start of the date time range covered by aggregated cost. + */ + @JsonProperty(value = "usageStart", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageStart; + + /* + * The end of the date time range covered by the aggregated cost. + */ + @JsonProperty(value = "usageEnd", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageEnd; + + /* + * Azure Charges. + */ + @JsonProperty(value = "azureCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal azureCharges; + + /* + * Marketplace Charges. + */ + @JsonProperty(value = "marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal marketplaceCharges; + + /* + * Charges Billed Separately. + */ + @JsonProperty(value = "chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal chargesBilledSeparately; + + /* + * The ISO currency in which the meter is charged, for example, USD. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * Children of a management group + */ + @JsonProperty(value = "children") + private List children; + + /* + * List of subscription Guids included in the calculation of aggregated + * cost + */ + @JsonProperty(value = "includedSubscriptions") + private List includedSubscriptions; + + /* + * List of subscription Guids excluded from the calculation of aggregated + * cost + */ + @JsonProperty(value = "excludedSubscriptions") + private List excludedSubscriptions; + + /** + * Get the billingPeriodId property: The id of the billing period resource that the aggregated cost belongs to. + * + * @return the billingPeriodId value. + */ + public String billingPeriodId() { + return this.billingPeriodId; + } + + /** + * Get the usageStart property: The start of the date time range covered by aggregated cost. + * + * @return the usageStart value. + */ + public OffsetDateTime usageStart() { + return this.usageStart; + } + + /** + * Get the usageEnd property: The end of the date time range covered by the aggregated cost. + * + * @return the usageEnd value. + */ + public OffsetDateTime usageEnd() { + return this.usageEnd; + } + + /** + * Get the azureCharges property: Azure Charges. + * + * @return the azureCharges value. + */ + public BigDecimal azureCharges() { + return this.azureCharges; + } + + /** + * Get the marketplaceCharges property: Marketplace Charges. + * + * @return the marketplaceCharges value. + */ + public BigDecimal marketplaceCharges() { + return this.marketplaceCharges; + } + + /** + * Get the chargesBilledSeparately property: Charges Billed Separately. + * + * @return the chargesBilledSeparately value. + */ + public BigDecimal chargesBilledSeparately() { + return this.chargesBilledSeparately; + } + + /** + * Get the currency property: The ISO currency in which the meter is charged, for example, USD. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the children property: Children of a management group. + * + * @return the children value. + */ + public List children() { + return this.children; + } + + /** + * Set the children property: Children of a management group. + * + * @param children the children value to set. + * @return the ManagementGroupAggregatedCostProperties object itself. + */ + public ManagementGroupAggregatedCostProperties withChildren( + List children) { + this.children = children; + return this; + } + + /** + * Get the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated + * cost. + * + * @return the includedSubscriptions value. + */ + public List includedSubscriptions() { + return this.includedSubscriptions; + } + + /** + * Set the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated + * cost. + * + * @param includedSubscriptions the includedSubscriptions value to set. + * @return the ManagementGroupAggregatedCostProperties object itself. + */ + public ManagementGroupAggregatedCostProperties withIncludedSubscriptions(List includedSubscriptions) { + this.includedSubscriptions = includedSubscriptions; + return this; + } + + /** + * Get the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated + * cost. + * + * @return the excludedSubscriptions value. + */ + public List excludedSubscriptions() { + return this.excludedSubscriptions; + } + + /** + * Set the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated + * cost. + * + * @param excludedSubscriptions the excludedSubscriptions value to set. + * @return the ManagementGroupAggregatedCostProperties object itself. + */ + public ManagementGroupAggregatedCostProperties withExcludedSubscriptions(List excludedSubscriptions) { + this.excludedSubscriptions = excludedSubscriptions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (children() != null) { + children().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java index d5ace675a1a9..dfe72201c6f3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostResultInner.java @@ -5,10 +5,10 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -16,85 +16,55 @@ import java.util.Map; /** A management group aggregated cost resource. */ -@JsonFlatten @Fluent -public class ManagementGroupAggregatedCostResultInner extends ProxyResource { +public final class ManagementGroupAggregatedCostResultInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupAggregatedCostResultInner.class); /* - * The id of the billing period resource that the aggregated cost belongs - * to. + * The properties of the Management Group Aggregated Cost. */ - @JsonProperty(value = "properties.billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) - private String billingPeriodId; + @JsonProperty(value = "properties") + private ManagementGroupAggregatedCostProperties innerProperties; /* - * The start of the date time range covered by aggregated cost. + * The etag for the resource. */ - @JsonProperty(value = "properties.usageStart", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageStart; - - /* - * The end of the date time range covered by the aggregated cost. - */ - @JsonProperty(value = "properties.usageEnd", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageEnd; - - /* - * Azure Charges. - */ - @JsonProperty(value = "properties.azureCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal azureCharges; - - /* - * Marketplace Charges. - */ - @JsonProperty(value = "properties.marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal marketplaceCharges; - - /* - * Charges Billed Separately. - */ - @JsonProperty(value = "properties.chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal chargesBilledSeparately; - - /* - * The ISO currency in which the meter is charged, for example, USD. - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * Children of a management group - */ - @JsonProperty(value = "properties.children") - private List children; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * List of subscription Guids included in the calculation of aggregated - * cost + * Resource tags. */ - @JsonProperty(value = "properties.includedSubscriptions") - private List includedSubscriptions; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * List of subscription Guids excluded from the calculation of aggregated - * cost + /** + * Get the innerProperties property: The properties of the Management Group Aggregated Cost. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.excludedSubscriptions") - private List excludedSubscriptions; + private ManagementGroupAggregatedCostProperties innerProperties() { + return this.innerProperties; + } - /* - * Resource etag. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public String etag() { + return this.etag; + } - /* - * Resource tags. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Map tags() { + return this.tags; + } /** * Get the billingPeriodId property: The id of the billing period resource that the aggregated cost belongs to. @@ -102,7 +72,7 @@ public class ManagementGroupAggregatedCostResultInner extends ProxyResource { * @return the billingPeriodId value. */ public String billingPeriodId() { - return this.billingPeriodId; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodId(); } /** @@ -111,7 +81,7 @@ public String billingPeriodId() { * @return the usageStart value. */ public OffsetDateTime usageStart() { - return this.usageStart; + return this.innerProperties() == null ? null : this.innerProperties().usageStart(); } /** @@ -120,7 +90,7 @@ public OffsetDateTime usageStart() { * @return the usageEnd value. */ public OffsetDateTime usageEnd() { - return this.usageEnd; + return this.innerProperties() == null ? null : this.innerProperties().usageEnd(); } /** @@ -129,7 +99,7 @@ public OffsetDateTime usageEnd() { * @return the azureCharges value. */ public BigDecimal azureCharges() { - return this.azureCharges; + return this.innerProperties() == null ? null : this.innerProperties().azureCharges(); } /** @@ -138,7 +108,7 @@ public BigDecimal azureCharges() { * @return the marketplaceCharges value. */ public BigDecimal marketplaceCharges() { - return this.marketplaceCharges; + return this.innerProperties() == null ? null : this.innerProperties().marketplaceCharges(); } /** @@ -147,7 +117,7 @@ public BigDecimal marketplaceCharges() { * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { - return this.chargesBilledSeparately; + return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); } /** @@ -156,7 +126,7 @@ public BigDecimal chargesBilledSeparately() { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -165,7 +135,7 @@ public String currency() { * @return the children value. */ public List children() { - return this.children; + return this.innerProperties() == null ? null : this.innerProperties().children(); } /** @@ -176,7 +146,10 @@ public List children() { */ public ManagementGroupAggregatedCostResultInner withChildren( List children) { - this.children = children; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupAggregatedCostProperties(); + } + this.innerProperties().withChildren(children); return this; } @@ -187,7 +160,7 @@ public ManagementGroupAggregatedCostResultInner withChildren( * @return the includedSubscriptions value. */ public List includedSubscriptions() { - return this.includedSubscriptions; + return this.innerProperties() == null ? null : this.innerProperties().includedSubscriptions(); } /** @@ -198,7 +171,10 @@ public List includedSubscriptions() { * @return the ManagementGroupAggregatedCostResultInner object itself. */ public ManagementGroupAggregatedCostResultInner withIncludedSubscriptions(List includedSubscriptions) { - this.includedSubscriptions = includedSubscriptions; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupAggregatedCostProperties(); + } + this.innerProperties().withIncludedSubscriptions(includedSubscriptions); return this; } @@ -209,7 +185,7 @@ public ManagementGroupAggregatedCostResultInner withIncludedSubscriptions(List excludedSubscriptions() { - return this.excludedSubscriptions; + return this.innerProperties() == null ? null : this.innerProperties().excludedSubscriptions(); } /** @@ -220,36 +196,21 @@ public List excludedSubscriptions() { * @return the ManagementGroupAggregatedCostResultInner object itself. */ public ManagementGroupAggregatedCostResultInner withExcludedSubscriptions(List excludedSubscriptions) { - this.excludedSubscriptions = excludedSubscriptions; + if (this.innerProperties() == null) { + this.innerProperties = new ManagementGroupAggregatedCostProperties(); + } + this.innerProperties().withExcludedSubscriptions(excludedSubscriptions); return this; } - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (children() != null) { - children().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java index 7c7981342d4e..659cbacda58b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java @@ -4,192 +4,67 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Map; import java.util.UUID; -/** An marketplace resource. */ -@JsonFlatten -@Immutable -public class MarketplaceInner extends ProxyResource { +/** A marketplace resource. */ +@Fluent +public final class MarketplaceInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceInner.class); /* - * The id of the billing period resource that the usage belongs to. + * The properties of the marketplace usage detail. */ - @JsonProperty(value = "properties.billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) - private String billingPeriodId; + @JsonProperty(value = "properties") + private MarketplaceProperties innerProperties; /* - * The start of the date time range covered by the usage detail. + * The etag for the resource. */ - @JsonProperty(value = "properties.usageStart", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageStart; - - /* - * The end of the date time range covered by the usage detail. - */ - @JsonProperty(value = "properties.usageEnd", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageEnd; - - /* - * The marketplace resource rate. - */ - @JsonProperty(value = "properties.resourceRate", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal resourceRate; - - /* - * The type of offer. - */ - @JsonProperty(value = "properties.offerName", access = JsonProperty.Access.WRITE_ONLY) - private String offerName; - - /* - * The name of resource group. - */ - @JsonProperty(value = "properties.resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * Additional information. - */ - @JsonProperty(value = "properties.additionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private String additionalInfo; - - /* - * The order number. - */ - @JsonProperty(value = "properties.orderNumber", access = JsonProperty.Access.WRITE_ONLY) - private String orderNumber; - - /* - * The name of the resource instance that the usage is about. - */ - @JsonProperty(value = "properties.instanceName", access = JsonProperty.Access.WRITE_ONLY) - private String instanceName; - - /* - * The uri of the resource instance that the usage is about. - */ - @JsonProperty(value = "properties.instanceId", access = JsonProperty.Access.WRITE_ONLY) - private String instanceId; - - /* - * The ISO currency in which the meter is charged, for example, USD. - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * The quantity of usage. - */ - @JsonProperty(value = "properties.consumedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal consumedQuantity; - - /* - * The unit of measure. - */ - @JsonProperty(value = "properties.unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) - private String unitOfMeasure; - - /* - * The amount of cost before tax. - */ - @JsonProperty(value = "properties.pretaxCost", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal pretaxCost; - - /* - * The estimated usage is subject to change. - */ - @JsonProperty(value = "properties.isEstimated", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isEstimated; - - /* - * The meter id (GUID). - */ - @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private UUID meterId; - - /* - * Subscription guid. - */ - @JsonProperty(value = "properties.subscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) - private UUID subscriptionGuid; - - /* - * Subscription name. - */ - @JsonProperty(value = "properties.subscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionName; - - /* - * Account name. - */ - @JsonProperty(value = "properties.accountName", access = JsonProperty.Access.WRITE_ONLY) - private String accountName; - - /* - * Department name. - */ - @JsonProperty(value = "properties.departmentName", access = JsonProperty.Access.WRITE_ONLY) - private String departmentName; - - /* - * Consumed service name. - */ - @JsonProperty(value = "properties.consumedService", access = JsonProperty.Access.WRITE_ONLY) - private String consumedService; - - /* - * The cost center of this department if it is a department and a - * costcenter exists - */ - @JsonProperty(value = "properties.costCenter", access = JsonProperty.Access.WRITE_ONLY) - private String costCenter; - - /* - * Additional details of this usage item. By default this is not populated, - * unless it's specified in $expand. - */ - @JsonProperty(value = "properties.additionalProperties", access = JsonProperty.Access.WRITE_ONLY) - private String additionalProperties; - - /* - * The name of publisher. - */ - @JsonProperty(value = "properties.publisherName", access = JsonProperty.Access.WRITE_ONLY) - private String publisherName; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * The name of plan. + * Resource tags. */ - @JsonProperty(value = "properties.planName", access = JsonProperty.Access.WRITE_ONLY) - private String planName; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * Flag indicating whether this is a recurring charge or not. + /** + * Get the innerProperties property: The properties of the marketplace usage detail. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.isRecurringCharge", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isRecurringCharge; + private MarketplaceProperties innerProperties() { + return this.innerProperties; + } - /* - * Resource etag. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public String etag() { + return this.etag; + } - /* - * Resource tags. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Map tags() { + return this.tags; + } /** * Get the billingPeriodId property: The id of the billing period resource that the usage belongs to. @@ -197,7 +72,7 @@ public class MarketplaceInner extends ProxyResource { * @return the billingPeriodId value. */ public String billingPeriodId() { - return this.billingPeriodId; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodId(); } /** @@ -206,7 +81,7 @@ public String billingPeriodId() { * @return the usageStart value. */ public OffsetDateTime usageStart() { - return this.usageStart; + return this.innerProperties() == null ? null : this.innerProperties().usageStart(); } /** @@ -215,7 +90,7 @@ public OffsetDateTime usageStart() { * @return the usageEnd value. */ public OffsetDateTime usageEnd() { - return this.usageEnd; + return this.innerProperties() == null ? null : this.innerProperties().usageEnd(); } /** @@ -224,7 +99,7 @@ public OffsetDateTime usageEnd() { * @return the resourceRate value. */ public BigDecimal resourceRate() { - return this.resourceRate; + return this.innerProperties() == null ? null : this.innerProperties().resourceRate(); } /** @@ -233,7 +108,7 @@ public BigDecimal resourceRate() { * @return the offerName value. */ public String offerName() { - return this.offerName; + return this.innerProperties() == null ? null : this.innerProperties().offerName(); } /** @@ -242,7 +117,7 @@ public String offerName() { * @return the resourceGroup value. */ public String resourceGroup() { - return this.resourceGroup; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); } /** @@ -251,7 +126,7 @@ public String resourceGroup() { * @return the additionalInfo value. */ public String additionalInfo() { - return this.additionalInfo; + return this.innerProperties() == null ? null : this.innerProperties().additionalInfo(); } /** @@ -260,7 +135,7 @@ public String additionalInfo() { * @return the orderNumber value. */ public String orderNumber() { - return this.orderNumber; + return this.innerProperties() == null ? null : this.innerProperties().orderNumber(); } /** @@ -269,7 +144,7 @@ public String orderNumber() { * @return the instanceName value. */ public String instanceName() { - return this.instanceName; + return this.innerProperties() == null ? null : this.innerProperties().instanceName(); } /** @@ -278,7 +153,7 @@ public String instanceName() { * @return the instanceId value. */ public String instanceId() { - return this.instanceId; + return this.innerProperties() == null ? null : this.innerProperties().instanceId(); } /** @@ -287,7 +162,7 @@ public String instanceId() { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -296,7 +171,7 @@ public String currency() { * @return the consumedQuantity value. */ public BigDecimal consumedQuantity() { - return this.consumedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().consumedQuantity(); } /** @@ -305,7 +180,7 @@ public BigDecimal consumedQuantity() { * @return the unitOfMeasure value. */ public String unitOfMeasure() { - return this.unitOfMeasure; + return this.innerProperties() == null ? null : this.innerProperties().unitOfMeasure(); } /** @@ -314,7 +189,7 @@ public String unitOfMeasure() { * @return the pretaxCost value. */ public BigDecimal pretaxCost() { - return this.pretaxCost; + return this.innerProperties() == null ? null : this.innerProperties().pretaxCost(); } /** @@ -323,7 +198,7 @@ public BigDecimal pretaxCost() { * @return the isEstimated value. */ public Boolean isEstimated() { - return this.isEstimated; + return this.innerProperties() == null ? null : this.innerProperties().isEstimated(); } /** @@ -332,7 +207,7 @@ public Boolean isEstimated() { * @return the meterId value. */ public UUID meterId() { - return this.meterId; + return this.innerProperties() == null ? null : this.innerProperties().meterId(); } /** @@ -341,7 +216,7 @@ public UUID meterId() { * @return the subscriptionGuid value. */ public UUID subscriptionGuid() { - return this.subscriptionGuid; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionGuid(); } /** @@ -350,7 +225,7 @@ public UUID subscriptionGuid() { * @return the subscriptionName value. */ public String subscriptionName() { - return this.subscriptionName; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); } /** @@ -359,7 +234,7 @@ public String subscriptionName() { * @return the accountName value. */ public String accountName() { - return this.accountName; + return this.innerProperties() == null ? null : this.innerProperties().accountName(); } /** @@ -368,7 +243,7 @@ public String accountName() { * @return the departmentName value. */ public String departmentName() { - return this.departmentName; + return this.innerProperties() == null ? null : this.innerProperties().departmentName(); } /** @@ -377,7 +252,7 @@ public String departmentName() { * @return the consumedService value. */ public String consumedService() { - return this.consumedService; + return this.innerProperties() == null ? null : this.innerProperties().consumedService(); } /** @@ -386,7 +261,7 @@ public String consumedService() { * @return the costCenter value. */ public String costCenter() { - return this.costCenter; + return this.innerProperties() == null ? null : this.innerProperties().costCenter(); } /** @@ -396,7 +271,7 @@ public String costCenter() { * @return the additionalProperties value. */ public String additionalProperties() { - return this.additionalProperties; + return this.innerProperties() == null ? null : this.innerProperties().additionalProperties(); } /** @@ -405,7 +280,7 @@ public String additionalProperties() { * @return the publisherName value. */ public String publisherName() { - return this.publisherName; + return this.innerProperties() == null ? null : this.innerProperties().publisherName(); } /** @@ -414,7 +289,7 @@ public String publisherName() { * @return the planName value. */ public String planName() { - return this.planName; + return this.innerProperties() == null ? null : this.innerProperties().planName(); } /** @@ -423,25 +298,7 @@ public String planName() { * @return the isRecurringCharge value. */ public Boolean isRecurringCharge() { - return this.isRecurringCharge; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().isRecurringCharge(); } /** @@ -450,5 +307,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java new file mode 100644 index 000000000000..006420b0220a --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.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.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The properties of the marketplace usage detail. */ +@Immutable +public final class MarketplaceProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceProperties.class); + + /* + * The id of the billing period resource that the usage belongs to. + */ + @JsonProperty(value = "billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) + private String billingPeriodId; + + /* + * The start of the date time range covered by the usage detail. + */ + @JsonProperty(value = "usageStart", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageStart; + + /* + * The end of the date time range covered by the usage detail. + */ + @JsonProperty(value = "usageEnd", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageEnd; + + /* + * The marketplace resource rate. + */ + @JsonProperty(value = "resourceRate", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal resourceRate; + + /* + * The type of offer. + */ + @JsonProperty(value = "offerName", access = JsonProperty.Access.WRITE_ONLY) + private String offerName; + + /* + * The name of resource group. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /* + * Additional information. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String additionalInfo; + + /* + * The order number. + */ + @JsonProperty(value = "orderNumber", access = JsonProperty.Access.WRITE_ONLY) + private String orderNumber; + + /* + * The name of the resource instance that the usage is about. + */ + @JsonProperty(value = "instanceName", access = JsonProperty.Access.WRITE_ONLY) + private String instanceName; + + /* + * The uri of the resource instance that the usage is about. + */ + @JsonProperty(value = "instanceId", access = JsonProperty.Access.WRITE_ONLY) + private String instanceId; + + /* + * The ISO currency in which the meter is charged, for example, USD. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * The quantity of usage. + */ + @JsonProperty(value = "consumedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal consumedQuantity; + + /* + * The unit of measure. + */ + @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) + private String unitOfMeasure; + + /* + * The amount of cost before tax. + */ + @JsonProperty(value = "pretaxCost", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal pretaxCost; + + /* + * The estimated usage is subject to change. + */ + @JsonProperty(value = "isEstimated", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEstimated; + + /* + * The meter id (GUID). + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private UUID meterId; + + /* + * Subscription guid. + */ + @JsonProperty(value = "subscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionGuid; + + /* + * Subscription name. + */ + @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; + + /* + * Account name. + */ + @JsonProperty(value = "accountName", access = JsonProperty.Access.WRITE_ONLY) + private String accountName; + + /* + * Department name. + */ + @JsonProperty(value = "departmentName", access = JsonProperty.Access.WRITE_ONLY) + private String departmentName; + + /* + * Consumed service name. + */ + @JsonProperty(value = "consumedService", access = JsonProperty.Access.WRITE_ONLY) + private String consumedService; + + /* + * The cost center of this department if it is a department and a + * costcenter exists + */ + @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) + private String costCenter; + + /* + * Additional details of this usage item. By default this is not populated, + * unless it's specified in $expand. + */ + @JsonProperty(value = "additionalProperties", access = JsonProperty.Access.WRITE_ONLY) + private String additionalProperties; + + /* + * The name of publisher. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * The name of plan. + */ + @JsonProperty(value = "planName", access = JsonProperty.Access.WRITE_ONLY) + private String planName; + + /* + * Flag indicating whether this is a recurring charge or not. + */ + @JsonProperty(value = "isRecurringCharge", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isRecurringCharge; + + /** + * Get the billingPeriodId property: The id of the billing period resource that the usage belongs to. + * + * @return the billingPeriodId value. + */ + public String billingPeriodId() { + return this.billingPeriodId; + } + + /** + * Get the usageStart property: The start of the date time range covered by the usage detail. + * + * @return the usageStart value. + */ + public OffsetDateTime usageStart() { + return this.usageStart; + } + + /** + * Get the usageEnd property: The end of the date time range covered by the usage detail. + * + * @return the usageEnd value. + */ + public OffsetDateTime usageEnd() { + return this.usageEnd; + } + + /** + * Get the resourceRate property: The marketplace resource rate. + * + * @return the resourceRate value. + */ + public BigDecimal resourceRate() { + return this.resourceRate; + } + + /** + * Get the offerName property: The type of offer. + * + * @return the offerName value. + */ + public String offerName() { + return this.offerName; + } + + /** + * Get the resourceGroup property: The name of resource group. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Get the additionalInfo property: Additional information. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * Get the orderNumber property: The order number. + * + * @return the orderNumber value. + */ + public String orderNumber() { + return this.orderNumber; + } + + /** + * Get the instanceName property: The name of the resource instance that the usage is about. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Get the instanceId property: The uri of the resource instance that the usage is about. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Get the currency property: The ISO currency in which the meter is charged, for example, USD. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the consumedQuantity property: The quantity of usage. + * + * @return the consumedQuantity value. + */ + public BigDecimal consumedQuantity() { + return this.consumedQuantity; + } + + /** + * Get the unitOfMeasure property: The unit of measure. + * + * @return the unitOfMeasure value. + */ + public String unitOfMeasure() { + return this.unitOfMeasure; + } + + /** + * Get the pretaxCost property: The amount of cost before tax. + * + * @return the pretaxCost value. + */ + public BigDecimal pretaxCost() { + return this.pretaxCost; + } + + /** + * Get the isEstimated property: The estimated usage is subject to change. + * + * @return the isEstimated value. + */ + public Boolean isEstimated() { + return this.isEstimated; + } + + /** + * Get the meterId property: The meter id (GUID). + * + * @return the meterId value. + */ + public UUID meterId() { + return this.meterId; + } + + /** + * Get the subscriptionGuid property: Subscription guid. + * + * @return the subscriptionGuid value. + */ + public UUID subscriptionGuid() { + return this.subscriptionGuid; + } + + /** + * Get the subscriptionName property: Subscription name. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Get the accountName property: Account name. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Get the departmentName property: Department name. + * + * @return the departmentName value. + */ + public String departmentName() { + return this.departmentName; + } + + /** + * Get the consumedService property: Consumed service name. + * + * @return the consumedService value. + */ + public String consumedService() { + return this.consumedService; + } + + /** + * Get the costCenter property: The cost center of this department if it is a department and a costcenter exists. + * + * @return the costCenter value. + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Get the additionalProperties property: Additional details of this usage item. By default this is not populated, + * unless it's specified in $expand. + * + * @return the additionalProperties value. + */ + public String additionalProperties() { + return this.additionalProperties; + } + + /** + * Get the publisherName property: The name of publisher. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the planName property: The name of plan. + * + * @return the planName value. + */ + public String planName() { + return this.planName; + } + + /** + * Get the isRecurringCharge property: Flag indicating whether this is a recurring charge or not. + * + * @return the isRecurringCharge value. + */ + public Boolean isRecurringCharge() { + return this.isRecurringCharge; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java new file mode 100644 index 000000000000..9a5a2f9e026a --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Amount; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of modern charge summary. */ +@Immutable +public final class ModernChargeSummaryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummaryProperties.class); + + /* + * The id of the billing period resource that the charge belongs to. + */ + @JsonProperty(value = "billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) + private String billingPeriodId; + + /* + * Usage start date. + */ + @JsonProperty(value = "usageStart", access = JsonProperty.Access.WRITE_ONLY) + private String usageStart; + + /* + * Usage end date. + */ + @JsonProperty(value = "usageEnd", access = JsonProperty.Access.WRITE_ONLY) + private String usageEnd; + + /* + * Azure Charges. + */ + @JsonProperty(value = "azureCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount azureCharges; + + /* + * Charges Billed separately. + */ + @JsonProperty(value = "chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) + private Amount chargesBilledSeparately; + + /* + * Marketplace Charges. + */ + @JsonProperty(value = "marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) + private Amount marketplaceCharges; + + /* + * Billing Account Id + */ + @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /* + * Billing Profile Id + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * Invoice Section Id + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /* + * Customer Id + */ + @JsonProperty(value = "customerId", access = JsonProperty.Access.WRITE_ONLY) + private String customerId; + + /* + * Is charge Invoiced + */ + @JsonProperty(value = "isInvoiced", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isInvoiced; + + /** + * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. + * + * @return the billingPeriodId value. + */ + public String billingPeriodId() { + return this.billingPeriodId; + } + + /** + * Get the usageStart property: Usage start date. + * + * @return the usageStart value. + */ + public String usageStart() { + return this.usageStart; + } + + /** + * Get the usageEnd property: Usage end date. + * + * @return the usageEnd value. + */ + public String usageEnd() { + return this.usageEnd; + } + + /** + * Get the azureCharges property: Azure Charges. + * + * @return the azureCharges value. + */ + public Amount azureCharges() { + return this.azureCharges; + } + + /** + * Get the chargesBilledSeparately property: Charges Billed separately. + * + * @return the chargesBilledSeparately value. + */ + public Amount chargesBilledSeparately() { + return this.chargesBilledSeparately; + } + + /** + * Get the marketplaceCharges property: Marketplace Charges. + * + * @return the marketplaceCharges value. + */ + public Amount marketplaceCharges() { + return this.marketplaceCharges; + } + + /** + * Get the billingAccountId property: Billing Account Id. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the billingProfileId property: Billing Profile Id. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the invoiceSectionId property: Invoice Section Id. + * + * @return the invoiceSectionId value. + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get the customerId property: Customer Id. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Get the isInvoiced property: Is charge Invoiced. + * + * @return the isInvoiced value. + */ + public Boolean isInvoiced() { + return this.isInvoiced; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureCharges() != null) { + azureCharges().validate(); + } + if (chargesBilledSeparately() != null) { + chargesBilledSeparately().validate(); + } + if (marketplaceCharges() != null) { + marketplaceCharges().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java new file mode 100644 index 000000000000..00df5480536b --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Amount; +import com.azure.resourcemanager.consumption.models.SkuProperty; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.List; +import java.util.UUID; + +/** The properties of the reservation recommendation. */ +@Immutable +public final class ModernReservationRecommendationProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendationProperties.class); + + /* + * Resource Location. + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * The number of days of usage to look back for recommendation. + */ + @JsonProperty(value = "lookBackPeriod", access = JsonProperty.Access.WRITE_ONLY) + private Integer lookBackPeriod; + + /* + * The instance Flexibility Ratio. + */ + @JsonProperty(value = "instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) + private Float instanceFlexibilityRatio; + + /* + * The instance Flexibility Group. + */ + @JsonProperty(value = "instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) + private String instanceFlexibilityGroup; + + /* + * The normalized Size. + */ + @JsonProperty(value = "normalizedSize", access = JsonProperty.Access.WRITE_ONLY) + private String normalizedSize; + + /* + * The recommended Quantity Normalized. + */ + @JsonProperty(value = "recommendedQuantityNormalized", access = JsonProperty.Access.WRITE_ONLY) + private Float recommendedQuantityNormalized; + + /* + * The meter id (GUID) + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private UUID meterId; + + /* + * RI recommendations in one or three year terms. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * The total amount of cost without reserved instances. + */ + @JsonProperty(value = "costWithNoReservedInstances", access = JsonProperty.Access.WRITE_ONLY) + private Amount costWithNoReservedInstances; + + /* + * Recommended quality for reserved instances. + */ + @JsonProperty(value = "recommendedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal recommendedQuantity; + + /* + * The total amount of cost with reserved instances. + */ + @JsonProperty(value = "totalCostWithReservedInstances", access = JsonProperty.Access.WRITE_ONLY) + private Amount totalCostWithReservedInstances; + + /* + * Total estimated savings with reserved instances. + */ + @JsonProperty(value = "netSavings", access = JsonProperty.Access.WRITE_ONLY) + private Amount netSavings; + + /* + * The usage date for looking back. + */ + @JsonProperty(value = "firstUsageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime firstUsageDate; + + /* + * Shared or single recommendation. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * List of sku properties + */ + @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY) + private List skuProperties; + + /* + * This is the ARM Sku name. + */ + @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) + private String skuName; + + /** + * Get the location property: Resource Location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. + * + * @return the lookBackPeriod value. + */ + public Integer lookBackPeriod() { + return this.lookBackPeriod; + } + + /** + * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. + * + * @return the instanceFlexibilityRatio value. + */ + public Float instanceFlexibilityRatio() { + return this.instanceFlexibilityRatio; + } + + /** + * Get the instanceFlexibilityGroup property: The instance Flexibility Group. + * + * @return the instanceFlexibilityGroup value. + */ + public String instanceFlexibilityGroup() { + return this.instanceFlexibilityGroup; + } + + /** + * Get the normalizedSize property: The normalized Size. + * + * @return the normalizedSize value. + */ + public String normalizedSize() { + return this.normalizedSize; + } + + /** + * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. + * + * @return the recommendedQuantityNormalized value. + */ + public Float recommendedQuantityNormalized() { + return this.recommendedQuantityNormalized; + } + + /** + * Get the meterId property: The meter id (GUID). + * + * @return the meterId value. + */ + public UUID meterId() { + return this.meterId; + } + + /** + * Get the term property: RI recommendations in one or three year terms. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. + * + * @return the costWithNoReservedInstances value. + */ + public Amount costWithNoReservedInstances() { + return this.costWithNoReservedInstances; + } + + /** + * Get the recommendedQuantity property: Recommended quality for reserved instances. + * + * @return the recommendedQuantity value. + */ + public BigDecimal recommendedQuantity() { + return this.recommendedQuantity; + } + + /** + * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. + * + * @return the totalCostWithReservedInstances value. + */ + public Amount totalCostWithReservedInstances() { + return this.totalCostWithReservedInstances; + } + + /** + * Get the netSavings property: Total estimated savings with reserved instances. + * + * @return the netSavings value. + */ + public Amount netSavings() { + return this.netSavings; + } + + /** + * Get the firstUsageDate property: The usage date for looking back. + * + * @return the firstUsageDate value. + */ + public OffsetDateTime firstUsageDate() { + return this.firstUsageDate; + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the skuProperties property: List of sku properties. + * + * @return the skuProperties value. + */ + public List skuProperties() { + return this.skuProperties; + } + + /** + * Get the skuName property: This is the ARM Sku name. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (costWithNoReservedInstances() != null) { + costWithNoReservedInstances().validate(); + } + if (totalCostWithReservedInstances() != null) { + totalCostWithReservedInstances().validate(); + } + if (netSavings() != null) { + netSavings().validate(); + } + if (skuProperties() != null) { + skuProperties().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java index 444c92f8195d..636c1f94bcf5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationTransactionResource; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -15,134 +14,24 @@ import java.util.UUID; /** Modern Reservation transaction resource. */ -@JsonFlatten -@Immutable -public class ModernReservationTransactionInner extends ReservationTransactionResource { +@Fluent +public final class ModernReservationTransactionInner extends ReservationTransactionResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionInner.class); /* - * The charge of the transaction. + * The properties of a modern reservation transaction. */ - @JsonProperty(value = "properties.amount", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal amount; + @JsonProperty(value = "properties", required = true) + private ModernReservationTransactionProperties innerProperties = new ModernReservationTransactionProperties(); - /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. - */ - @JsonProperty(value = "properties.armSkuName", access = JsonProperty.Access.WRITE_ONLY) - private String armSkuName; - - /* - * The billing frequency, which can be either one-time or recurring. - */ - @JsonProperty(value = "properties.billingFrequency", access = JsonProperty.Access.WRITE_ONLY) - private String billingFrequency; - - /* - * Billing profile Id. - */ - @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * Billing profile name. - */ - @JsonProperty(value = "properties.billingProfileName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileName; - - /* - * The ISO currency in which the transaction is charged, for example, USD. - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * The description of the transaction. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The date of the transaction - */ - @JsonProperty(value = "properties.eventDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime eventDate; - - /* - * The type of the transaction (Purchase, Cancel, etc.) - */ - @JsonProperty(value = "properties.eventType", access = JsonProperty.Access.WRITE_ONLY) - private String eventType; - - /* - * Invoice Number - */ - @JsonProperty(value = "properties.invoice", access = JsonProperty.Access.WRITE_ONLY) - private String invoice; - - /* - * Invoice Id as on the invoice where the specific transaction appears. - */ - @JsonProperty(value = "properties.invoiceId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceId; - - /* - * Invoice Section Id - */ - @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * Invoice Section Name. - */ - @JsonProperty(value = "properties.invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionName; - - /* - * The subscription guid that makes the transaction. - */ - @JsonProperty(value = "properties.purchasingSubscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) - private UUID purchasingSubscriptionGuid; - - /* - * The subscription name that makes the transaction. - */ - @JsonProperty(value = "properties.purchasingSubscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String purchasingSubscriptionName; - - /* - * The quantity of the transaction. - */ - @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal quantity; - - /* - * The region of the transaction. - */ - @JsonProperty(value = "properties.region", access = JsonProperty.Access.WRITE_ONLY) - private String region; - - /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. - */ - @JsonProperty(value = "properties.reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderId; - - /* - * The name of the reservation order. - */ - @JsonProperty(value = "properties.reservationOrderName", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderName; - - /* - * This is the term of the transaction. + /** + * Get the innerProperties property: The properties of a modern reservation transaction. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; + private ModernReservationTransactionProperties innerProperties() { + return this.innerProperties; + } /** * Get the amount property: The charge of the transaction. @@ -150,7 +39,7 @@ public class ModernReservationTransactionInner extends ReservationTransactionRes * @return the amount value. */ public BigDecimal amount() { - return this.amount; + return this.innerProperties() == null ? null : this.innerProperties().amount(); } /** @@ -160,7 +49,7 @@ public BigDecimal amount() { * @return the armSkuName value. */ public String armSkuName() { - return this.armSkuName; + return this.innerProperties() == null ? null : this.innerProperties().armSkuName(); } /** @@ -169,7 +58,7 @@ public String armSkuName() { * @return the billingFrequency value. */ public String billingFrequency() { - return this.billingFrequency; + return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); } /** @@ -178,7 +67,7 @@ public String billingFrequency() { * @return the billingProfileId value. */ public String billingProfileId() { - return this.billingProfileId; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -187,7 +76,7 @@ public String billingProfileId() { * @return the billingProfileName value. */ public String billingProfileName() { - return this.billingProfileName; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileName(); } /** @@ -196,7 +85,7 @@ public String billingProfileName() { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -205,7 +94,7 @@ public String currency() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -214,7 +103,7 @@ public String description() { * @return the eventDate value. */ public OffsetDateTime eventDate() { - return this.eventDate; + return this.innerProperties() == null ? null : this.innerProperties().eventDate(); } /** @@ -223,7 +112,7 @@ public OffsetDateTime eventDate() { * @return the eventType value. */ public String eventType() { - return this.eventType; + return this.innerProperties() == null ? null : this.innerProperties().eventType(); } /** @@ -232,7 +121,7 @@ public String eventType() { * @return the invoice value. */ public String invoice() { - return this.invoice; + return this.innerProperties() == null ? null : this.innerProperties().invoice(); } /** @@ -241,7 +130,7 @@ public String invoice() { * @return the invoiceId value. */ public String invoiceId() { - return this.invoiceId; + return this.innerProperties() == null ? null : this.innerProperties().invoiceId(); } /** @@ -250,7 +139,7 @@ public String invoiceId() { * @return the invoiceSectionId value. */ public String invoiceSectionId() { - return this.invoiceSectionId; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** @@ -259,7 +148,7 @@ public String invoiceSectionId() { * @return the invoiceSectionName value. */ public String invoiceSectionName() { - return this.invoiceSectionName; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionName(); } /** @@ -268,7 +157,7 @@ public String invoiceSectionName() { * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { - return this.purchasingSubscriptionGuid; + return this.innerProperties() == null ? null : this.innerProperties().purchasingSubscriptionGuid(); } /** @@ -277,7 +166,7 @@ public UUID purchasingSubscriptionGuid() { * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { - return this.purchasingSubscriptionName; + return this.innerProperties() == null ? null : this.innerProperties().purchasingSubscriptionName(); } /** @@ -286,7 +175,7 @@ public String purchasingSubscriptionName() { * @return the quantity value. */ public BigDecimal quantity() { - return this.quantity; + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** @@ -295,7 +184,7 @@ public BigDecimal quantity() { * @return the region value. */ public String region() { - return this.region; + return this.innerProperties() == null ? null : this.innerProperties().region(); } /** @@ -306,7 +195,7 @@ public String region() { * @return the reservationOrderId value. */ public String reservationOrderId() { - return this.reservationOrderId; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderId(); } /** @@ -315,7 +204,7 @@ public String reservationOrderId() { * @return the reservationOrderName value. */ public String reservationOrderName() { - return this.reservationOrderName; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderName(); } /** @@ -324,7 +213,7 @@ public String reservationOrderName() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -335,5 +224,13 @@ public String term() { @Override public void validate() { super.validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ModernReservationTransactionInner")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java new file mode 100644 index 000000000000..fb749b85a558 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The properties of a modern reservation transaction. */ +@Immutable +public final class ModernReservationTransactionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionProperties.class); + + /* + * The charge of the transaction. + */ + @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal amount; + + /* + * This is the ARM Sku name. It can be used to join with the serviceType + * field in additional info in usage records. + */ + @JsonProperty(value = "armSkuName", access = JsonProperty.Access.WRITE_ONLY) + private String armSkuName; + + /* + * The billing frequency, which can be either one-time or recurring. + */ + @JsonProperty(value = "billingFrequency", access = JsonProperty.Access.WRITE_ONLY) + private String billingFrequency; + + /* + * Billing profile Id. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * Billing profile name. + */ + @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileName; + + /* + * The ISO currency in which the transaction is charged, for example, USD. + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * The description of the transaction. + */ + @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) + private String description; + + /* + * The date of the transaction + */ + @JsonProperty(value = "eventDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime eventDate; + + /* + * The type of the transaction (Purchase, Cancel, etc.) + */ + @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) + private String eventType; + + /* + * Invoice Number + */ + @JsonProperty(value = "invoice", access = JsonProperty.Access.WRITE_ONLY) + private String invoice; + + /* + * Invoice Id as on the invoice where the specific transaction appears. + */ + @JsonProperty(value = "invoiceId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceId; + + /* + * Invoice Section Id + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /* + * Invoice Section Name. + */ + @JsonProperty(value = "invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionName; + + /* + * The subscription guid that makes the transaction. + */ + @JsonProperty(value = "purchasingSubscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) + private UUID purchasingSubscriptionGuid; + + /* + * The subscription name that makes the transaction. + */ + @JsonProperty(value = "purchasingSubscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String purchasingSubscriptionName; + + /* + * The quantity of the transaction. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal quantity; + + /* + * The region of the transaction. + */ + @JsonProperty(value = "region", access = JsonProperty.Access.WRITE_ONLY) + private String region; + + /* + * The reservation order ID is the identifier for a reservation purchase. + * Each reservation order ID represents a single purchase transaction. A + * reservation order contains reservations. The reservation order specifies + * the VM size and region for the reservations. + */ + @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderId; + + /* + * The name of the reservation order. + */ + @JsonProperty(value = "reservationOrderName", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderName; + + /* + * This is the term of the transaction. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /** + * Get the amount property: The charge of the transaction. + * + * @return the amount value. + */ + public BigDecimal amount() { + return this.amount; + } + + /** + * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in + * additional info in usage records. + * + * @return the armSkuName value. + */ + public String armSkuName() { + return this.armSkuName; + } + + /** + * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. + * + * @return the billingFrequency value. + */ + public String billingFrequency() { + return this.billingFrequency; + } + + /** + * Get the billingProfileId property: Billing profile Id. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileName property: Billing profile name. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.billingProfileName; + } + + /** + * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the description property: The description of the transaction. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the eventDate property: The date of the transaction. + * + * @return the eventDate value. + */ + public OffsetDateTime eventDate() { + return this.eventDate; + } + + /** + * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * + * @return the eventType value. + */ + public String eventType() { + return this.eventType; + } + + /** + * Get the invoice property: Invoice Number. + * + * @return the invoice value. + */ + public String invoice() { + return this.invoice; + } + + /** + * Get the invoiceId property: Invoice Id as on the invoice where the specific transaction appears. + * + * @return the invoiceId value. + */ + public String invoiceId() { + return this.invoiceId; + } + + /** + * Get the invoiceSectionId property: Invoice Section Id. + * + * @return the invoiceSectionId value. + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get the invoiceSectionName property: Invoice Section Name. + * + * @return the invoiceSectionName value. + */ + public String invoiceSectionName() { + return this.invoiceSectionName; + } + + /** + * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. + * + * @return the purchasingSubscriptionGuid value. + */ + public UUID purchasingSubscriptionGuid() { + return this.purchasingSubscriptionGuid; + } + + /** + * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. + * + * @return the purchasingSubscriptionName value. + */ + public String purchasingSubscriptionName() { + return this.purchasingSubscriptionName; + } + + /** + * Get the quantity property: The quantity of the transaction. + * + * @return the quantity value. + */ + public BigDecimal quantity() { + return this.quantity; + } + + /** + * Get the region property: The region of the transaction. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each + * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The + * reservation order specifies the VM size and region for the reservations. + * + * @return the reservationOrderId value. + */ + public String reservationOrderId() { + return this.reservationOrderId; + } + + /** + * Get the reservationOrderName property: The name of the reservation order. + * + * @return the reservationOrderName value. + */ + public String reservationOrderName() { + return this.reservationOrderName; + } + + /** + * Get the term property: This is the term of the transaction. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java new file mode 100644 index 000000000000..00c64480a2cd --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java @@ -0,0 +1,1193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.PricingModelType; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.UUID; + +/** The properties of the usage detail. */ +@Immutable +public final class ModernUsageDetailProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetailProperties.class); + + /* + * Billing Account identifier. + */ + @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /* + * Effective Price that's charged for the usage. + */ + @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal effectivePrice; + + /* + * Identifier that indicates how the meter is priced + */ + @JsonProperty(value = "pricingModel", access = JsonProperty.Access.WRITE_ONLY) + private PricingModelType pricingModel; + + /* + * Name of the Billing Account. + */ + @JsonProperty(value = "billingAccountName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountName; + + /* + * Billing Period Start Date as in the invoice. + */ + @JsonProperty(value = "billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime billingPeriodStartDate; + + /* + * Billing Period End Date as in the invoice. + */ + @JsonProperty(value = "billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime billingPeriodEndDate; + + /* + * Identifier for the billing profile that groups costs across invoices in + * the a singular billing currency across across the customers who have + * onboarded the Microsoft customer agreement and the customers in CSP who + * have made entitlement purchases like SaaS, Marketplace, RI, etc. + */ + @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; + + /* + * Name of the billing profile that groups costs across invoices in the a + * singular billing currency across across the customers who have onboarded + * the Microsoft customer agreement and the customers in CSP who have made + * entitlement purchases like SaaS, Marketplace, RI, etc. + */ + @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileName; + + /* + * Unique Microsoft generated identifier for the Azure Subscription. + */ + @JsonProperty(value = "subscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionGuid; + + /* + * Name of the Azure Subscription. + */ + @JsonProperty(value = "subscriptionName", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionName; + + /* + * Date for the usage record. + */ + @JsonProperty(value = "date", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime date; + + /* + * Name of the product that has accrued charges by consumption or purchase + * as listed in the invoice. Not available for Marketplace. + */ + @JsonProperty(value = "product", access = JsonProperty.Access.WRITE_ONLY) + private String product; + + /* + * The meter id (GUID). Not available for marketplace. For reserved + * instance this represents the primary meter for which the reservation was + * purchased. For the actual VM Size for which the reservation is purchased + * see productOrderName. + */ + @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) + private UUID meterId; + + /* + * Identifies the name of the meter against which consumption is measured. + */ + @JsonProperty(value = "meterName", access = JsonProperty.Access.WRITE_ONLY) + private String meterName; + + /* + * Identifies the location of the datacenter for certain services that are + * priced based on datacenter location. + */ + @JsonProperty(value = "meterRegion", access = JsonProperty.Access.WRITE_ONLY) + private String meterRegion; + + /* + * Identifies the top-level service for the usage. + */ + @JsonProperty(value = "meterCategory", access = JsonProperty.Access.WRITE_ONLY) + private String meterCategory; + + /* + * Defines the type or sub-category of Azure service that can affect the + * rate. + */ + @JsonProperty(value = "meterSubCategory", access = JsonProperty.Access.WRITE_ONLY) + private String meterSubCategory; + + /* + * List the service family for the product purchased or charged (Example: + * Storage ; Compute). + */ + @JsonProperty(value = "serviceFamily", access = JsonProperty.Access.WRITE_ONLY) + private String serviceFamily; + + /* + * Measure the quantity purchased or consumed.The amount of the meter used + * during the billing period. + */ + @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal quantity; + + /* + * Identifies the Unit that the service is charged in. For example, GB, + * hours, 10,000 s. + */ + @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) + private String unitOfMeasure; + + /* + * Instance Name. + */ + @JsonProperty(value = "instanceName", access = JsonProperty.Access.WRITE_ONLY) + private String instanceName; + + /* + * Estimated extendedCost or blended cost before tax in USD. + */ + @JsonProperty(value = "costInUSD", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal costInUsd; + + /* + * Unit Price is the price applicable to you. (your EA or other contract + * price). + */ + @JsonProperty(value = "unitPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal unitPrice; + + /* + * The currency defining the billed cost. + */ + @JsonProperty(value = "billingCurrencyCode", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrencyCode; + + /* + * Name of the resource location. + */ + @JsonProperty(value = "resourceLocation", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocation; + + /* + * Consumed service name. Name of the azure resource provider that emits + * the usage or was purchased. This value is not provided for marketplace + * usage. + */ + @JsonProperty(value = "consumedService", access = JsonProperty.Access.WRITE_ONLY) + private String consumedService; + + /* + * Service-specific metadata. + */ + @JsonProperty(value = "serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) + private String serviceInfo1; + + /* + * Legacy field with optional service-specific metadata. + */ + @JsonProperty(value = "serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) + private String serviceInfo2; + + /* + * Additional details of this usage item. Use this field to get usage line + * item specific details such as the actual VM Size (ServiceType) or the + * ratio in which the reservation discount is applied. + */ + @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) + private String additionalInfo; + + /* + * Identifier of the project that is being charged in the invoice. Not + * applicable for Microsoft Customer Agreements onboarded by partners. + */ + @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionId; + + /* + * Name of the project that is being charged in the invoice. Not applicable + * for Microsoft Customer Agreements onboarded by partners. + */ + @JsonProperty(value = "invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceSectionName; + + /* + * The cost center of this department if it is a department and a cost + * center is provided. + */ + @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) + private String costCenter; + + /* + * Name of the Azure resource group used for cohesive lifecycle management + * of resources. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /* + * ARM resource id of the reservation. Only applies to records relevant to + * reservations. + */ + @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * User provided display name of the reservation. Last known name for a + * particular day is populated in the daily data. Only applies to records + * relevant to reservations. + */ + @JsonProperty(value = "reservationName", access = JsonProperty.Access.WRITE_ONLY) + private String reservationName; + + /* + * The identifier for the asset or Azure plan name that the subscription + * belongs to. For example: Azure Plan. For reservations this is the + * Reservation Order ID. + */ + @JsonProperty(value = "productOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String productOrderId; + + /* + * Product Order Name. For reservations this is the SKU that was purchased. + */ + @JsonProperty(value = "productOrderName", access = JsonProperty.Access.WRITE_ONLY) + private String productOrderName; + + /* + * Determines if the cost is eligible to be paid for using Azure credits. + */ + @JsonProperty(value = "isAzureCreditEligible", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isAzureCreditEligible; + + /* + * Term (in months). Displays the term for the validity of the offer. For + * example. In case of reserved instances it displays 12 months for yearly + * term of reserved instance. For one time purchases or recurring + * purchases, the terms displays 1 month; This is not applicable for Azure + * consumption. + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * Name of the publisher of the service including Microsoft or Third Party + * publishers. + */ + @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) + private String publisherName; + + /* + * Type of publisher that identifies if the publisher is first party, third + * party reseller or third party agency. + */ + @JsonProperty(value = "publisherType", access = JsonProperty.Access.WRITE_ONLY) + private String publisherType; + + /* + * Indicates a charge represents credits, usage, a Marketplace purchase, a + * reservation fee, or a refund. + */ + @JsonProperty(value = "chargeType", access = JsonProperty.Access.WRITE_ONLY) + private String chargeType; + + /* + * Indicates how frequently this charge will occur. OneTime for purchases + * which only happen once, Monthly for fees which recur every month, and + * UsageBased for charges based on how much a service is used. + */ + @JsonProperty(value = "frequency", access = JsonProperty.Access.WRITE_ONLY) + private String frequency; + + /* + * ExtendedCost or blended cost before tax in billed currency. + */ + @JsonProperty(value = "costInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal costInBillingCurrency; + + /* + * ExtendedCost or blended cost before tax in pricing currency to correlate + * with prices. + */ + @JsonProperty(value = "costInPricingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal costInPricingCurrency; + + /* + * Exchange rate used in conversion from pricing currency to billing + * currency. + */ + @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) + private String exchangeRate; + + /* + * Date on which exchange rate used in conversion from pricing currency to + * billing currency. + */ + @JsonProperty(value = "exchangeRateDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime exchangeRateDate; + + /* + * Invoice ID as on the invoice where the specific transaction appears. + */ + @JsonProperty(value = "invoiceId", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceId; + + /* + * Reference to an original invoice there is a refund (negative cost). This + * is populated only when there is a refund. + */ + @JsonProperty(value = "previousInvoiceId", access = JsonProperty.Access.WRITE_ONLY) + private String previousInvoiceId; + + /* + * Pricing Billing Currency. + */ + @JsonProperty(value = "pricingCurrencyCode", access = JsonProperty.Access.WRITE_ONLY) + private String pricingCurrencyCode; + + /* + * Identifier for the product that has accrued charges by consumption or + * purchase . This is the concatenated key of productId and SkuId in + * partner center. + */ + @JsonProperty(value = "productIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String productIdentifier; + + /* + * Resource Location Normalized. + */ + @JsonProperty(value = "resourceLocationNormalized", access = JsonProperty.Access.WRITE_ONLY) + private String resourceLocationNormalized; + + /* + * Start date for the rating period when the service usage was rated for + * charges. The prices for Azure services are determined for the rating + * period. + */ + @JsonProperty(value = "servicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime servicePeriodStartDate; + + /* + * End date for the period when the service usage was rated for charges. + * The prices for Azure services are determined based on the rating period. + */ + @JsonProperty(value = "servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime servicePeriodEndDate; + + /* + * Identifier of the customer's AAD tenant. + */ + @JsonProperty(value = "customerTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String customerTenantId; + + /* + * Name of the customer's AAD tenant. + */ + @JsonProperty(value = "customerName", access = JsonProperty.Access.WRITE_ONLY) + private String customerName; + + /* + * Identifier for the partner's AAD tenant. + */ + @JsonProperty(value = "partnerTenantId", access = JsonProperty.Access.WRITE_ONLY) + private String partnerTenantId; + + /* + * Name of the partner' AAD tenant. + */ + @JsonProperty(value = "partnerName", access = JsonProperty.Access.WRITE_ONLY) + private String partnerName; + + /* + * MPNId for the reseller associated with the subscription. + */ + @JsonProperty(value = "resellerMpnId", access = JsonProperty.Access.WRITE_ONLY) + private String resellerMpnId; + + /* + * Reseller Name. + */ + @JsonProperty(value = "resellerName", access = JsonProperty.Access.WRITE_ONLY) + private String resellerName; + + /* + * Publisher Id. + */ + @JsonProperty(value = "publisherId", access = JsonProperty.Access.WRITE_ONLY) + private String publisherId; + + /* + * Market Price that's charged for the usage. + */ + @JsonProperty(value = "marketPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal marketPrice; + + /* + * Exchange Rate from pricing currency to billing currency. + */ + @JsonProperty(value = "exchangeRatePricingToBilling", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal exchangeRatePricingToBilling; + + /* + * The amount of PayG cost before tax in billing currency. + */ + @JsonProperty(value = "paygCostInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal paygCostInBillingCurrency; + + /* + * The amount of PayG cost before tax in US Dollar currency. + */ + @JsonProperty(value = "paygCostInUSD", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal paygCostInUsd; + + /* + * Rate of discount applied if there is a partner earned credit (PEC) based + * on partner admin link access. + */ + @JsonProperty(value = "partnerEarnedCreditRate", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal partnerEarnedCreditRate; + + /* + * Flag to indicate if partner earned credit has been applied or not. + */ + @JsonProperty(value = "partnerEarnedCreditApplied", access = JsonProperty.Access.WRITE_ONLY) + private String partnerEarnedCreditApplied; + + /* + * Retail price for the resource. + */ + @JsonProperty(value = "payGPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal payGPrice; + + /* + * Unique identifier for the applicable benefit. + */ + @JsonProperty(value = "benefitId", access = JsonProperty.Access.WRITE_ONLY) + private String benefitId; + + /* + * Name of the applicable benefit. + */ + @JsonProperty(value = "benefitName", access = JsonProperty.Access.WRITE_ONLY) + private String benefitName; + + /* + * Identifier for Product Category or Line Of Business, Ex - Azure, + * Microsoft 365, AWS e.t.c + */ + @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) + private String provider; + + /* + * Name for Cost Allocation Rule. + */ + @JsonProperty(value = "costAllocationRuleName", access = JsonProperty.Access.WRITE_ONLY) + private String costAllocationRuleName; + + /** + * Get the billingAccountId property: Billing Account identifier. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the effectivePrice property: Effective Price that's charged for the usage. + * + * @return the effectivePrice value. + */ + public BigDecimal effectivePrice() { + return this.effectivePrice; + } + + /** + * Get the pricingModel property: Identifier that indicates how the meter is priced. + * + * @return the pricingModel value. + */ + public PricingModelType pricingModel() { + return this.pricingModel; + } + + /** + * Get the billingAccountName property: Name of the Billing Account. + * + * @return the billingAccountName value. + */ + public String billingAccountName() { + return this.billingAccountName; + } + + /** + * Get the billingPeriodStartDate property: Billing Period Start Date as in the invoice. + * + * @return the billingPeriodStartDate value. + */ + public OffsetDateTime billingPeriodStartDate() { + return this.billingPeriodStartDate; + } + + /** + * Get the billingPeriodEndDate property: Billing Period End Date as in the invoice. + * + * @return the billingPeriodEndDate value. + */ + public OffsetDateTime billingPeriodEndDate() { + return this.billingPeriodEndDate; + } + + /** + * Get the billingProfileId property: Identifier for the billing profile that groups costs across invoices in the a + * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the + * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * + * @return the billingProfileId value. + */ + public String billingProfileId() { + return this.billingProfileId; + } + + /** + * Get the billingProfileName property: Name of the billing profile that groups costs across invoices in the a + * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the + * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. + * + * @return the billingProfileName value. + */ + public String billingProfileName() { + return this.billingProfileName; + } + + /** + * Get the subscriptionGuid property: Unique Microsoft generated identifier for the Azure Subscription. + * + * @return the subscriptionGuid value. + */ + public String subscriptionGuid() { + return this.subscriptionGuid; + } + + /** + * Get the subscriptionName property: Name of the Azure Subscription. + * + * @return the subscriptionName value. + */ + public String subscriptionName() { + return this.subscriptionName; + } + + /** + * Get the date property: Date for the usage record. + * + * @return the date value. + */ + public OffsetDateTime date() { + return this.date; + } + + /** + * Get the product property: Name of the product that has accrued charges by consumption or purchase as listed in + * the invoice. Not available for Marketplace. + * + * @return the product value. + */ + public String product() { + return this.product; + } + + /** + * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this + * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the + * reservation is purchased see productOrderName. + * + * @return the meterId value. + */ + public UUID meterId() { + return this.meterId; + } + + /** + * Get the meterName property: Identifies the name of the meter against which consumption is measured. + * + * @return the meterName value. + */ + public String meterName() { + return this.meterName; + } + + /** + * Get the meterRegion property: Identifies the location of the datacenter for certain services that are priced + * based on datacenter location. + * + * @return the meterRegion value. + */ + public String meterRegion() { + return this.meterRegion; + } + + /** + * Get the meterCategory property: Identifies the top-level service for the usage. + * + * @return the meterCategory value. + */ + public String meterCategory() { + return this.meterCategory; + } + + /** + * Get the meterSubCategory property: Defines the type or sub-category of Azure service that can affect the rate. + * + * @return the meterSubCategory value. + */ + public String meterSubCategory() { + return this.meterSubCategory; + } + + /** + * Get the serviceFamily property: List the service family for the product purchased or charged (Example: Storage ; + * Compute). + * + * @return the serviceFamily value. + */ + public String serviceFamily() { + return this.serviceFamily; + } + + /** + * Get the quantity property: Measure the quantity purchased or consumed.The amount of the meter used during the + * billing period. + * + * @return the quantity value. + */ + public BigDecimal quantity() { + return this.quantity; + } + + /** + * Get the unitOfMeasure property: Identifies the Unit that the service is charged in. For example, GB, hours, + * 10,000 s. + * + * @return the unitOfMeasure value. + */ + public String unitOfMeasure() { + return this.unitOfMeasure; + } + + /** + * Get the instanceName property: Instance Name. + * + * @return the instanceName value. + */ + public String instanceName() { + return this.instanceName; + } + + /** + * Get the costInUsd property: Estimated extendedCost or blended cost before tax in USD. + * + * @return the costInUsd value. + */ + public BigDecimal costInUsd() { + return this.costInUsd; + } + + /** + * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). + * + * @return the unitPrice value. + */ + public BigDecimal unitPrice() { + return this.unitPrice; + } + + /** + * Get the billingCurrencyCode property: The currency defining the billed cost. + * + * @return the billingCurrencyCode value. + */ + public String billingCurrencyCode() { + return this.billingCurrencyCode; + } + + /** + * Get the resourceLocation property: Name of the resource location. + * + * @return the resourceLocation value. + */ + public String resourceLocation() { + return this.resourceLocation; + } + + /** + * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage + * or was purchased. This value is not provided for marketplace usage. + * + * @return the consumedService value. + */ + public String consumedService() { + return this.consumedService; + } + + /** + * Get the serviceInfo1 property: Service-specific metadata. + * + * @return the serviceInfo1 value. + */ + public String serviceInfo1() { + return this.serviceInfo1; + } + + /** + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. + * + * @return the serviceInfo2 value. + */ + public String serviceInfo2() { + return this.serviceInfo2; + } + + /** + * Get the additionalInfo property: Additional details of this usage item. Use this field to get usage line item + * specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is + * applied. + * + * @return the additionalInfo value. + */ + public String additionalInfo() { + return this.additionalInfo; + } + + /** + * Get the invoiceSectionId property: Identifier of the project that is being charged in the invoice. Not applicable + * for Microsoft Customer Agreements onboarded by partners. + * + * @return the invoiceSectionId value. + */ + public String invoiceSectionId() { + return this.invoiceSectionId; + } + + /** + * Get the invoiceSectionName property: Name of the project that is being charged in the invoice. Not applicable for + * Microsoft Customer Agreements onboarded by partners. + * + * @return the invoiceSectionName value. + */ + public String invoiceSectionName() { + return this.invoiceSectionName; + } + + /** + * Get the costCenter property: The cost center of this department if it is a department and a cost center is + * provided. + * + * @return the costCenter value. + */ + public String costCenter() { + return this.costCenter; + } + + /** + * Get the resourceGroup property: Name of the Azure resource group used for cohesive lifecycle management of + * resources. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to + * reservations. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the reservationName property: User provided display name of the reservation. Last known name for a particular + * day is populated in the daily data. Only applies to records relevant to reservations. + * + * @return the reservationName value. + */ + public String reservationName() { + return this.reservationName; + } + + /** + * Get the productOrderId property: The identifier for the asset or Azure plan name that the subscription belongs + * to. For example: Azure Plan. For reservations this is the Reservation Order ID. + * + * @return the productOrderId value. + */ + public String productOrderId() { + return this.productOrderId; + } + + /** + * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. + * + * @return the productOrderName value. + */ + public String productOrderName() { + return this.productOrderName; + } + + /** + * Get the isAzureCreditEligible property: Determines if the cost is eligible to be paid for using Azure credits. + * + * @return the isAzureCreditEligible value. + */ + public Boolean isAzureCreditEligible() { + return this.isAzureCreditEligible; + } + + /** + * Get the term property: Term (in months). Displays the term for the validity of the offer. For example. In case of + * reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or + * recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the publisherName property: Name of the publisher of the service including Microsoft or Third Party + * publishers. + * + * @return the publisherName value. + */ + public String publisherName() { + return this.publisherName; + } + + /** + * Get the publisherType property: Type of publisher that identifies if the publisher is first party, third party + * reseller or third party agency. + * + * @return the publisherType value. + */ + public String publisherType() { + return this.publisherType; + } + + /** + * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation + * fee, or a refund. + * + * @return the chargeType value. + */ + public String chargeType() { + return this.chargeType; + } + + /** + * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only + * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is + * used. + * + * @return the frequency value. + */ + public String frequency() { + return this.frequency; + } + + /** + * Get the costInBillingCurrency property: ExtendedCost or blended cost before tax in billed currency. + * + * @return the costInBillingCurrency value. + */ + public BigDecimal costInBillingCurrency() { + return this.costInBillingCurrency; + } + + /** + * Get the costInPricingCurrency property: ExtendedCost or blended cost before tax in pricing currency to correlate + * with prices. + * + * @return the costInPricingCurrency value. + */ + public BigDecimal costInPricingCurrency() { + return this.costInPricingCurrency; + } + + /** + * Get the exchangeRate property: Exchange rate used in conversion from pricing currency to billing currency. + * + * @return the exchangeRate value. + */ + public String exchangeRate() { + return this.exchangeRate; + } + + /** + * Get the exchangeRateDate property: Date on which exchange rate used in conversion from pricing currency to + * billing currency. + * + * @return the exchangeRateDate value. + */ + public OffsetDateTime exchangeRateDate() { + return this.exchangeRateDate; + } + + /** + * Get the invoiceId property: Invoice ID as on the invoice where the specific transaction appears. + * + * @return the invoiceId value. + */ + public String invoiceId() { + return this.invoiceId; + } + + /** + * Get the previousInvoiceId property: Reference to an original invoice there is a refund (negative cost). This is + * populated only when there is a refund. + * + * @return the previousInvoiceId value. + */ + public String previousInvoiceId() { + return this.previousInvoiceId; + } + + /** + * Get the pricingCurrencyCode property: Pricing Billing Currency. + * + * @return the pricingCurrencyCode value. + */ + public String pricingCurrencyCode() { + return this.pricingCurrencyCode; + } + + /** + * Get the productIdentifier property: Identifier for the product that has accrued charges by consumption or + * purchase . This is the concatenated key of productId and SkuId in partner center. + * + * @return the productIdentifier value. + */ + public String productIdentifier() { + return this.productIdentifier; + } + + /** + * Get the resourceLocationNormalized property: Resource Location Normalized. + * + * @return the resourceLocationNormalized value. + */ + public String resourceLocationNormalized() { + return this.resourceLocationNormalized; + } + + /** + * Get the servicePeriodStartDate property: Start date for the rating period when the service usage was rated for + * charges. The prices for Azure services are determined for the rating period. + * + * @return the servicePeriodStartDate value. + */ + public OffsetDateTime servicePeriodStartDate() { + return this.servicePeriodStartDate; + } + + /** + * Get the servicePeriodEndDate property: End date for the period when the service usage was rated for charges. The + * prices for Azure services are determined based on the rating period. + * + * @return the servicePeriodEndDate value. + */ + public OffsetDateTime servicePeriodEndDate() { + return this.servicePeriodEndDate; + } + + /** + * Get the customerTenantId property: Identifier of the customer's AAD tenant. + * + * @return the customerTenantId value. + */ + public String customerTenantId() { + return this.customerTenantId; + } + + /** + * Get the customerName property: Name of the customer's AAD tenant. + * + * @return the customerName value. + */ + public String customerName() { + return this.customerName; + } + + /** + * Get the partnerTenantId property: Identifier for the partner's AAD tenant. + * + * @return the partnerTenantId value. + */ + public String partnerTenantId() { + return this.partnerTenantId; + } + + /** + * Get the partnerName property: Name of the partner' AAD tenant. + * + * @return the partnerName value. + */ + public String partnerName() { + return this.partnerName; + } + + /** + * Get the resellerMpnId property: MPNId for the reseller associated with the subscription. + * + * @return the resellerMpnId value. + */ + public String resellerMpnId() { + return this.resellerMpnId; + } + + /** + * Get the resellerName property: Reseller Name. + * + * @return the resellerName value. + */ + public String resellerName() { + return this.resellerName; + } + + /** + * Get the publisherId property: Publisher Id. + * + * @return the publisherId value. + */ + public String publisherId() { + return this.publisherId; + } + + /** + * Get the marketPrice property: Market Price that's charged for the usage. + * + * @return the marketPrice value. + */ + public BigDecimal marketPrice() { + return this.marketPrice; + } + + /** + * Get the exchangeRatePricingToBilling property: Exchange Rate from pricing currency to billing currency. + * + * @return the exchangeRatePricingToBilling value. + */ + public BigDecimal exchangeRatePricingToBilling() { + return this.exchangeRatePricingToBilling; + } + + /** + * Get the paygCostInBillingCurrency property: The amount of PayG cost before tax in billing currency. + * + * @return the paygCostInBillingCurrency value. + */ + public BigDecimal paygCostInBillingCurrency() { + return this.paygCostInBillingCurrency; + } + + /** + * Get the paygCostInUsd property: The amount of PayG cost before tax in US Dollar currency. + * + * @return the paygCostInUsd value. + */ + public BigDecimal paygCostInUsd() { + return this.paygCostInUsd; + } + + /** + * Get the partnerEarnedCreditRate property: Rate of discount applied if there is a partner earned credit (PEC) + * based on partner admin link access. + * + * @return the partnerEarnedCreditRate value. + */ + public BigDecimal partnerEarnedCreditRate() { + return this.partnerEarnedCreditRate; + } + + /** + * Get the partnerEarnedCreditApplied property: Flag to indicate if partner earned credit has been applied or not. + * + * @return the partnerEarnedCreditApplied value. + */ + public String partnerEarnedCreditApplied() { + return this.partnerEarnedCreditApplied; + } + + /** + * Get the payGPrice property: Retail price for the resource. + * + * @return the payGPrice value. + */ + public BigDecimal payGPrice() { + return this.payGPrice; + } + + /** + * Get the benefitId property: Unique identifier for the applicable benefit. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.benefitId; + } + + /** + * Get the benefitName property: Name of the applicable benefit. + * + * @return the benefitName value. + */ + public String benefitName() { + return this.benefitName; + } + + /** + * Get the provider property: Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS + * e.t.c. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Get the costAllocationRuleName property: Name for Cost Allocation Rule. + * + * @return the costAllocationRuleName value. + */ + public String costAllocationRuleName() { + return this.costAllocationRuleName; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java new file mode 100644 index 000000000000..0e4aa629a411 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.MeterDetails; +import com.azure.resourcemanager.consumption.models.PriceSheetProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** price sheet result. It contains the pricesheet associated with billing period. */ +@Immutable +public final class PriceSheetModel { + @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetModel.class); + + /* + * Price sheet + */ + @JsonProperty(value = "pricesheets", access = JsonProperty.Access.WRITE_ONLY) + private List pricesheets; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * Pricesheet download details. + */ + @JsonProperty(value = "download", access = JsonProperty.Access.WRITE_ONLY) + private MeterDetails download; + + /** + * Get the pricesheets property: Price sheet. + * + * @return the pricesheets value. + */ + public List pricesheets() { + return this.pricesheets; + } + + /** + * 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 download property: Pricesheet download details. + * + * @return the download value. + */ + public MeterDetails download() { + return this.download; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (pricesheets() != null) { + pricesheets().forEach(e -> e.validate()); + } + if (download() != null) { + download().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java index 9fba8d634b7e..7d19b3f74d32 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java @@ -4,43 +4,31 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.MeterDetails; import com.azure.resourcemanager.consumption.models.PriceSheetProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** An pricesheet resource. */ -@JsonFlatten -@Immutable -public class PriceSheetResultInner extends ProxyResource { +@Fluent +public final class PriceSheetResultInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetResultInner.class); /* - * Price sheet + * price sheet result. It contains the pricesheet associated with billing + * period */ - @JsonProperty(value = "properties.pricesheets", access = JsonProperty.Access.WRITE_ONLY) - private List pricesheets; + @JsonProperty(value = "properties") + private PriceSheetModel innerProperties; /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "properties.nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /* - * Pricesheet download details. - */ - @JsonProperty(value = "properties.download", access = JsonProperty.Access.WRITE_ONLY) - private MeterDetails download; - - /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -49,51 +37,61 @@ public class PriceSheetResultInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the pricesheets property: Price sheet. + * Get the innerProperties property: price sheet result. It contains the pricesheet associated with billing period. * - * @return the pricesheets value. + * @return the innerProperties value. */ - public List pricesheets() { - return this.pricesheets; + private PriceSheetModel innerProperties() { + return this.innerProperties; } /** - * Get the nextLink property: The link (url) to the next page of results. + * Get the etag property: The etag for the resource. * - * @return the nextLink value. + * @return the etag value. */ - public String nextLink() { - return this.nextLink; + public String etag() { + return this.etag; } /** - * Get the download property: Pricesheet download details. + * Get the tags property: Resource tags. * - * @return the download value. + * @return the tags value. */ - public MeterDetails download() { - return this.download; + public Map tags() { + return this.tags; } /** - * Get the etag property: Resource etag. + * Get the pricesheets property: Price sheet. * - * @return the etag value. + * @return the pricesheets value. */ - public String etag() { - return this.etag; + public List pricesheets() { + return this.innerProperties() == null ? null : this.innerProperties().pricesheets(); } /** - * Get the tags property: Resource tags. + * Get the nextLink property: The link (url) to the next page of results. * - * @return the tags value. + * @return the nextLink value. */ - public Map tags() { - return this.tags; + public String nextLink() { + return this.innerProperties() == null ? null : this.innerProperties().nextLink(); + } + + /** + * Get the download property: Pricesheet download details. + * + * @return the download value. + */ + public MeterDetails download() { + return this.innerProperties() == null ? null : this.innerProperties().download(); } /** @@ -102,11 +100,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (pricesheets() != null) { - pricesheets().forEach(e -> e.validate()); - } - if (download() != null) { - download().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java index c00a1f591d98..ba58947769d8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java @@ -4,110 +4,66 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Map; /** reservation detail resource. */ -@JsonFlatten -@Immutable -public class ReservationDetailInner extends ProxyResource { +@Fluent +public final class ReservationDetailInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailInner.class); /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The properties of the reservation detail. */ - @JsonProperty(value = "properties.reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderId; + @JsonProperty(value = "properties") + private ReservationDetailProperties innerProperties; /* - * The instance Flexibility Ratio. + * The etag for the resource. */ - @JsonProperty(value = "properties.instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) - private String instanceFlexibilityRatio; - - /* - * The instance Flexibility Group. - */ - @JsonProperty(value = "properties.instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) - private String instanceFlexibilityGroup; - - /* - * The reservation ID is the identifier of a reservation within a - * reservation order. Each reservation is the grouping for applying the - * benefit scope and also specifies the number of instances to which the - * reservation benefit can be applied to. - */ - @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationId; - - /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. - */ - @JsonProperty(value = "properties.skuName", access = JsonProperty.Access.WRITE_ONLY) - private String skuName; - - /* - * This is the total hours reserved for the day. E.g. if reservation for 1 - * instance was made on 1 PM, this will be 11 hours for that day and 24 - * hours from subsequent days. - */ - @JsonProperty(value = "properties.reservedHours", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal reservedHours; - - /* - * The date on which consumption occurred. - */ - @JsonProperty(value = "properties.usageDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageDate; - - /* - * This is the total hours used by the instance. - */ - @JsonProperty(value = "properties.usedHours", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal usedHours; - - /* - * This identifier is the name of the resource or the fully qualified - * Resource ID. - */ - @JsonProperty(value = "properties.instanceId", access = JsonProperty.Access.WRITE_ONLY) - private String instanceId; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * This is the total count of instances that are reserved for the - * reservationId. + * Resource tags. */ - @JsonProperty(value = "properties.totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal totalReservedQuantity; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * The reservation kind. + /** + * Get the innerProperties property: The properties of the reservation detail. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; + private ReservationDetailProperties innerProperties() { + return this.innerProperties; + } - /* - * Resource etag. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public String etag() { + return this.etag; + } - /* - * Resource tags. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Map tags() { + return this.tags; + } /** * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each @@ -117,7 +73,7 @@ public class ReservationDetailInner extends ProxyResource { * @return the reservationOrderId value. */ public String reservationOrderId() { - return this.reservationOrderId; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderId(); } /** @@ -126,7 +82,7 @@ public String reservationOrderId() { * @return the instanceFlexibilityRatio value. */ public String instanceFlexibilityRatio() { - return this.instanceFlexibilityRatio; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityRatio(); } /** @@ -135,7 +91,7 @@ public String instanceFlexibilityRatio() { * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { - return this.instanceFlexibilityGroup; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityGroup(); } /** @@ -146,7 +102,7 @@ public String instanceFlexibilityGroup() { * @return the reservationId value. */ public String reservationId() { - return this.reservationId; + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); } /** @@ -156,7 +112,7 @@ public String reservationId() { * @return the skuName value. */ public String skuName() { - return this.skuName; + return this.innerProperties() == null ? null : this.innerProperties().skuName(); } /** @@ -166,7 +122,7 @@ public String skuName() { * @return the reservedHours value. */ public BigDecimal reservedHours() { - return this.reservedHours; + return this.innerProperties() == null ? null : this.innerProperties().reservedHours(); } /** @@ -175,7 +131,7 @@ public BigDecimal reservedHours() { * @return the usageDate value. */ public OffsetDateTime usageDate() { - return this.usageDate; + return this.innerProperties() == null ? null : this.innerProperties().usageDate(); } /** @@ -184,7 +140,7 @@ public OffsetDateTime usageDate() { * @return the usedHours value. */ public BigDecimal usedHours() { - return this.usedHours; + return this.innerProperties() == null ? null : this.innerProperties().usedHours(); } /** @@ -193,7 +149,7 @@ public BigDecimal usedHours() { * @return the instanceId value. */ public String instanceId() { - return this.instanceId; + return this.innerProperties() == null ? null : this.innerProperties().instanceId(); } /** @@ -203,7 +159,7 @@ public String instanceId() { * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { - return this.totalReservedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().totalReservedQuantity(); } /** @@ -212,25 +168,7 @@ public BigDecimal totalReservedQuantity() { * @return the kind value. */ public String kind() { - return this.kind; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().kind(); } /** @@ -239,5 +177,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java new file mode 100644 index 000000000000..99fe617af2d0 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.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.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; + +/** The properties of the reservation detail. */ +@Immutable +public final class ReservationDetailProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailProperties.class); + + /* + * The reservation order ID is the identifier for a reservation purchase. + * Each reservation order ID represents a single purchase transaction. A + * reservation order contains reservations. The reservation order specifies + * the VM size and region for the reservations. + */ + @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderId; + + /* + * The instance Flexibility Ratio. + */ + @JsonProperty(value = "instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) + private String instanceFlexibilityRatio; + + /* + * The instance Flexibility Group. + */ + @JsonProperty(value = "instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) + private String instanceFlexibilityGroup; + + /* + * The reservation ID is the identifier of a reservation within a + * reservation order. Each reservation is the grouping for applying the + * benefit scope and also specifies the number of instances to which the + * reservation benefit can be applied to. + */ + @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * This is the ARM Sku name. It can be used to join with the serviceType + * field in additional info in usage records. + */ + @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) + private String skuName; + + /* + * This is the total hours reserved for the day. E.g. if reservation for 1 + * instance was made on 1 PM, this will be 11 hours for that day and 24 + * hours from subsequent days. + */ + @JsonProperty(value = "reservedHours", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal reservedHours; + + /* + * The date on which consumption occurred. + */ + @JsonProperty(value = "usageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageDate; + + /* + * This is the total hours used by the instance. + */ + @JsonProperty(value = "usedHours", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal usedHours; + + /* + * This identifier is the name of the resource or the fully qualified + * Resource ID. + */ + @JsonProperty(value = "instanceId", access = JsonProperty.Access.WRITE_ONLY) + private String instanceId; + + /* + * This is the total count of instances that are reserved for the + * reservationId. + */ + @JsonProperty(value = "totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal totalReservedQuantity; + + /* + * The reservation kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /** + * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each + * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The + * reservation order specifies the VM size and region for the reservations. + * + * @return the reservationOrderId value. + */ + public String reservationOrderId() { + return this.reservationOrderId; + } + + /** + * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. + * + * @return the instanceFlexibilityRatio value. + */ + public String instanceFlexibilityRatio() { + return this.instanceFlexibilityRatio; + } + + /** + * Get the instanceFlexibilityGroup property: The instance Flexibility Group. + * + * @return the instanceFlexibilityGroup value. + */ + public String instanceFlexibilityGroup() { + return this.instanceFlexibilityGroup; + } + + /** + * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. + * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to + * which the reservation benefit can be applied to. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in + * additional info in usage records. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the reservedHours property: This is the total hours reserved for the day. E.g. if reservation for 1 instance + * was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. + * + * @return the reservedHours value. + */ + public BigDecimal reservedHours() { + return this.reservedHours; + } + + /** + * Get the usageDate property: The date on which consumption occurred. + * + * @return the usageDate value. + */ + public OffsetDateTime usageDate() { + return this.usageDate; + } + + /** + * Get the usedHours property: This is the total hours used by the instance. + * + * @return the usedHours value. + */ + public BigDecimal usedHours() { + return this.usedHours; + } + + /** + * Get the instanceId property: This identifier is the name of the resource or the fully qualified Resource ID. + * + * @return the instanceId value. + */ + public String instanceId() { + return this.instanceId; + } + + /** + * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the + * reservationId. + * + * @return the totalReservedQuantity value. + */ + public BigDecimal totalReservedQuantity() { + return this.totalReservedQuantity; + } + + /** + * Get the kind property: The reservation kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java index ae4134eeb55e..68e957a682f6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java @@ -5,20 +5,19 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsResourceProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsSavingsProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsUsageProperties; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; /** Reservation recommendation details. */ -@JsonFlatten @Fluent -public class ReservationRecommendationDetailsModelInner extends ProxyResource { +public final class ReservationRecommendationDetailsModelInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsModelInner.class); /* @@ -34,51 +33,22 @@ public class ReservationRecommendationDetailsModelInner extends ProxyResource { private String sku; /* - * Resource eTag. + * The properties of the reservation recommendation. */ - @JsonProperty(value = "eTag") - private String etag; - - /* - * An ISO 4217 currency code identifier for the costs and savings - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * Resource specific properties. - */ - @JsonProperty(value = "properties.resource", access = JsonProperty.Access.WRITE_ONLY) - private ReservationRecommendationDetailsResourceProperties resource; - - /* - * Resource Group. - */ - @JsonProperty(value = "properties.resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; + @JsonProperty(value = "properties") + private ReservationRecommendationDetailsProperties innerProperties; /* - * Savings information for the recommendation. + * The etag for the resource. */ - @JsonProperty(value = "properties.savings", access = JsonProperty.Access.WRITE_ONLY) - private ReservationRecommendationDetailsSavingsProperties savings; - - /* - * Scope of the reservation, ex: Single or Shared. - */ - @JsonProperty(value = "properties.scope", access = JsonProperty.Access.WRITE_ONLY) - private String scope; - - /* - * Historical usage details used to calculate the estimated savings. - */ - @JsonProperty(value = "properties.usage", access = JsonProperty.Access.WRITE_ONLY) - private ReservationRecommendationDetailsUsageProperties usage; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** @@ -122,7 +92,16 @@ public ReservationRecommendationDetailsModelInner withSku(String sku) { } /** - * Get the etag property: Resource eTag. + * Get the innerProperties property: The properties of the reservation recommendation. + * + * @return the innerProperties value. + */ + private ReservationRecommendationDetailsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -131,14 +110,12 @@ public String etag() { } /** - * Set the etag property: Resource eTag. + * Get the tags property: Resource tags. * - * @param etag the etag value to set. - * @return the ReservationRecommendationDetailsModelInner object itself. + * @return the tags value. */ - public ReservationRecommendationDetailsModelInner withEtag(String etag) { - this.etag = etag; - return this; + public Map tags() { + return this.tags; } /** @@ -147,7 +124,7 @@ public ReservationRecommendationDetailsModelInner withEtag(String etag) { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -156,7 +133,7 @@ public String currency() { * @return the resource value. */ public ReservationRecommendationDetailsResourceProperties resource() { - return this.resource; + return this.innerProperties() == null ? null : this.innerProperties().resource(); } /** @@ -165,7 +142,7 @@ public ReservationRecommendationDetailsResourceProperties resource() { * @return the resourceGroup value. */ public String resourceGroup() { - return this.resourceGroup; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); } /** @@ -174,7 +151,7 @@ public String resourceGroup() { * @return the savings value. */ public ReservationRecommendationDetailsSavingsProperties savings() { - return this.savings; + return this.innerProperties() == null ? null : this.innerProperties().savings(); } /** @@ -183,7 +160,7 @@ public ReservationRecommendationDetailsSavingsProperties savings() { * @return the scope value. */ public String scope() { - return this.scope; + return this.innerProperties() == null ? null : this.innerProperties().scope(); } /** @@ -192,16 +169,7 @@ public String scope() { * @return the usage value. */ public ReservationRecommendationDetailsUsageProperties usage() { - return this.usage; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().usage(); } /** @@ -210,14 +178,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (resource() != null) { - resource().validate(); - } - if (savings() != null) { - savings().validate(); - } - if (usage() != null) { - usage().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java new file mode 100644 index 000000000000..adeb2dae589c --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsResourceProperties; +import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsSavingsProperties; +import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsUsageProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** The properties of the reservation recommendation. */ +@Immutable +public final class ReservationRecommendationDetailsProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsProperties.class); + + /* + * An ISO 4217 currency code identifier for the costs and savings + */ + @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) + private String currency; + + /* + * Resource specific properties. + */ + @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) + private ReservationRecommendationDetailsResourceProperties resource; + + /* + * Resource Group. + */ + @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) + private String resourceGroup; + + /* + * Savings information for the recommendation. + */ + @JsonProperty(value = "savings", access = JsonProperty.Access.WRITE_ONLY) + private ReservationRecommendationDetailsSavingsProperties savings; + + /* + * Scope of the reservation, ex: Single or Shared. + */ + @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) + private String scope; + + /* + * Historical usage details used to calculate the estimated savings. + */ + @JsonProperty(value = "usage", access = JsonProperty.Access.WRITE_ONLY) + private ReservationRecommendationDetailsUsageProperties usage; + + /** + * Get the currency property: An ISO 4217 currency code identifier for the costs and savings. + * + * @return the currency value. + */ + public String currency() { + return this.currency; + } + + /** + * Get the resource property: Resource specific properties. + * + * @return the resource value. + */ + public ReservationRecommendationDetailsResourceProperties resource() { + return this.resource; + } + + /** + * Get the resourceGroup property: Resource Group. + * + * @return the resourceGroup value. + */ + public String resourceGroup() { + return this.resourceGroup; + } + + /** + * Get the savings property: Savings information for the recommendation. + * + * @return the savings value. + */ + public ReservationRecommendationDetailsSavingsProperties savings() { + return this.savings; + } + + /** + * Get the scope property: Scope of the reservation, ex: Single or Shared. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Get the usage property: Historical usage details used to calculate the estimated savings. + * + * @return the usage value. + */ + public ReservationRecommendationDetailsUsageProperties usage() { + return this.usage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (savings() != null) { + savings().validate(); + } + if (usage() != null) { + usage().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java index 91cae06f1219..45566e5e4012 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.LegacyReservationRecommendation; import com.azure.resourcemanager.consumption.models.ModernReservationRecommendation; -import com.azure.resourcemanager.consumption.models.ResourceAttributes; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -28,11 +29,11 @@ @JsonSubTypes.Type(name = "modern", value = ModernReservationRecommendation.class) }) @Immutable -public class ReservationRecommendationInner extends ResourceAttributes { +public class ReservationRecommendationInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationInner.class); /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -41,10 +42,23 @@ public class ReservationRecommendationInner extends ResourceAttributes { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /* + * Resource location + */ + @JsonProperty(value = "location", access = JsonProperty.Access.WRITE_ONLY) + private String location; + + /* + * Resource sku + */ + @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) + private String sku; + /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -61,13 +75,29 @@ public Map tags() { return this.tags; } + /** + * Get the location property: Resource location. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the sku property: Resource sku. + * + * @return the sku value. + */ + public String sku() { + return this.sku; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { - super.validate(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java index 239761bc9379..7b913e6e0ac3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java @@ -4,139 +4,66 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.Map; /** reservation summary resource. */ -@JsonFlatten -@Immutable -public class ReservationSummaryInner extends ProxyResource { +@Fluent +public final class ReservationSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryInner.class); /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The properties of the reservation summary. */ - @JsonProperty(value = "properties.reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderId; + @JsonProperty(value = "properties") + private ReservationSummaryProperties innerProperties; /* - * The reservation ID is the identifier of a reservation within a - * reservation order. Each reservation is the grouping for applying the - * benefit scope and also specifies the number of instances to which the - * reservation benefit can be applied to. + * The etag for the resource. */ - @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationId; - - /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. - */ - @JsonProperty(value = "properties.skuName", access = JsonProperty.Access.WRITE_ONLY) - private String skuName; - - /* - * This is the total hours reserved. E.g. if reservation for 1 instance was - * made on 1 PM, this will be 11 hours for that day and 24 hours from - * subsequent days - */ - @JsonProperty(value = "properties.reservedHours", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal reservedHours; - - /* - * Data corresponding to the utilization record. If the grain of data is - * monthly, it will be first day of month. - */ - @JsonProperty(value = "properties.usageDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime usageDate; - - /* - * Total used hours by the reservation - */ - @JsonProperty(value = "properties.usedHours", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal usedHours; - - /* - * This is the minimum hourly utilization in the usage time (day or month). - * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 - * and 5, utilization was 10%, this field will return 10% for that day - */ - @JsonProperty(value = "properties.minUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal minUtilizationPercentage; - - /* - * This is average utilization for the entire time range. (day or month - * depending on the grain) - */ - @JsonProperty(value = "properties.avgUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal avgUtilizationPercentage; - - /* - * This is the maximum hourly utilization in the usage time (day or month). - * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 - * and 5, utilization was 100%, this field will return 100% for that day. - */ - @JsonProperty(value = "properties.maxUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal maxUtilizationPercentage; - - /* - * The reservation kind. - */ - @JsonProperty(value = "properties.kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * This is the purchased quantity for the reservationId. - */ - @JsonProperty(value = "properties.purchasedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal purchasedQuantity; - - /* - * This is the remaining quantity for the reservationId. - */ - @JsonProperty(value = "properties.remainingQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal remainingQuantity; - - /* - * This is the total count of instances that are reserved for the - * reservationId. - */ - @JsonProperty(value = "properties.totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal totalReservedQuantity; + @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + private String etag; /* - * This is the used quantity for the reservationId. + * Resource tags. */ - @JsonProperty(value = "properties.usedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal usedQuantity; + @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map tags; - /* - * This is the utilized percentage for the reservation Id. + /** + * Get the innerProperties property: The properties of the reservation summary. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.utilizedPercentage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal utilizedPercentage; + private ReservationSummaryProperties innerProperties() { + return this.innerProperties; + } - /* - * Resource etag. + /** + * Get the etag property: The etag for the resource. + * + * @return the etag value. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; + public String etag() { + return this.etag; + } - /* - * Resource tags. + /** + * Get the tags property: Resource tags. + * + * @return the tags value. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - private Map tags; + public Map tags() { + return this.tags; + } /** * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each @@ -146,7 +73,7 @@ public class ReservationSummaryInner extends ProxyResource { * @return the reservationOrderId value. */ public String reservationOrderId() { - return this.reservationOrderId; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderId(); } /** @@ -157,7 +84,7 @@ public String reservationOrderId() { * @return the reservationId value. */ public String reservationId() { - return this.reservationId; + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); } /** @@ -167,7 +94,7 @@ public String reservationId() { * @return the skuName value. */ public String skuName() { - return this.skuName; + return this.innerProperties() == null ? null : this.innerProperties().skuName(); } /** @@ -177,7 +104,7 @@ public String skuName() { * @return the reservedHours value. */ public BigDecimal reservedHours() { - return this.reservedHours; + return this.innerProperties() == null ? null : this.innerProperties().reservedHours(); } /** @@ -187,7 +114,7 @@ public BigDecimal reservedHours() { * @return the usageDate value. */ public OffsetDateTime usageDate() { - return this.usageDate; + return this.innerProperties() == null ? null : this.innerProperties().usageDate(); } /** @@ -196,7 +123,7 @@ public OffsetDateTime usageDate() { * @return the usedHours value. */ public BigDecimal usedHours() { - return this.usedHours; + return this.innerProperties() == null ? null : this.innerProperties().usedHours(); } /** @@ -207,7 +134,7 @@ public BigDecimal usedHours() { * @return the minUtilizationPercentage value. */ public BigDecimal minUtilizationPercentage() { - return this.minUtilizationPercentage; + return this.innerProperties() == null ? null : this.innerProperties().minUtilizationPercentage(); } /** @@ -217,7 +144,7 @@ public BigDecimal minUtilizationPercentage() { * @return the avgUtilizationPercentage value. */ public BigDecimal avgUtilizationPercentage() { - return this.avgUtilizationPercentage; + return this.innerProperties() == null ? null : this.innerProperties().avgUtilizationPercentage(); } /** @@ -228,7 +155,7 @@ public BigDecimal avgUtilizationPercentage() { * @return the maxUtilizationPercentage value. */ public BigDecimal maxUtilizationPercentage() { - return this.maxUtilizationPercentage; + return this.innerProperties() == null ? null : this.innerProperties().maxUtilizationPercentage(); } /** @@ -237,7 +164,7 @@ public BigDecimal maxUtilizationPercentage() { * @return the kind value. */ public String kind() { - return this.kind; + return this.innerProperties() == null ? null : this.innerProperties().kind(); } /** @@ -246,7 +173,7 @@ public String kind() { * @return the purchasedQuantity value. */ public BigDecimal purchasedQuantity() { - return this.purchasedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().purchasedQuantity(); } /** @@ -255,7 +182,7 @@ public BigDecimal purchasedQuantity() { * @return the remainingQuantity value. */ public BigDecimal remainingQuantity() { - return this.remainingQuantity; + return this.innerProperties() == null ? null : this.innerProperties().remainingQuantity(); } /** @@ -265,7 +192,7 @@ public BigDecimal remainingQuantity() { * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { - return this.totalReservedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().totalReservedQuantity(); } /** @@ -274,7 +201,7 @@ public BigDecimal totalReservedQuantity() { * @return the usedQuantity value. */ public BigDecimal usedQuantity() { - return this.usedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().usedQuantity(); } /** @@ -283,25 +210,7 @@ public BigDecimal usedQuantity() { * @return the utilizedPercentage value. */ public BigDecimal utilizedPercentage() { - return this.utilizedPercentage; - } - - /** - * Get the etag property: Resource etag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Get the tags property: Resource tags. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().utilizedPercentage(); } /** @@ -310,5 +219,8 @@ public Map tags() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java new file mode 100644 index 000000000000..2bd838de647e --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; +import java.time.OffsetDateTime; + +/** The properties of the reservation summary. */ +@Immutable +public final class ReservationSummaryProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryProperties.class); + + /* + * The reservation order ID is the identifier for a reservation purchase. + * Each reservation order ID represents a single purchase transaction. A + * reservation order contains reservations. The reservation order specifies + * the VM size and region for the reservations. + */ + @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationOrderId; + + /* + * The reservation ID is the identifier of a reservation within a + * reservation order. Each reservation is the grouping for applying the + * benefit scope and also specifies the number of instances to which the + * reservation benefit can be applied to. + */ + @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) + private String reservationId; + + /* + * This is the ARM Sku name. It can be used to join with the serviceType + * field in additional info in usage records. + */ + @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) + private String skuName; + + /* + * This is the total hours reserved. E.g. if reservation for 1 instance was + * made on 1 PM, this will be 11 hours for that day and 24 hours from + * subsequent days + */ + @JsonProperty(value = "reservedHours", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal reservedHours; + + /* + * Data corresponding to the utilization record. If the grain of data is + * monthly, it will be first day of month. + */ + @JsonProperty(value = "usageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime usageDate; + + /* + * Total used hours by the reservation + */ + @JsonProperty(value = "usedHours", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal usedHours; + + /* + * This is the minimum hourly utilization in the usage time (day or month). + * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 + * and 5, utilization was 10%, this field will return 10% for that day + */ + @JsonProperty(value = "minUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal minUtilizationPercentage; + + /* + * This is average utilization for the entire time range. (day or month + * depending on the grain) + */ + @JsonProperty(value = "avgUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal avgUtilizationPercentage; + + /* + * This is the maximum hourly utilization in the usage time (day or month). + * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 + * and 5, utilization was 100%, this field will return 100% for that day. + */ + @JsonProperty(value = "maxUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal maxUtilizationPercentage; + + /* + * The reservation kind. + */ + @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) + private String kind; + + /* + * This is the purchased quantity for the reservationId. + */ + @JsonProperty(value = "purchasedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal purchasedQuantity; + + /* + * This is the remaining quantity for the reservationId. + */ + @JsonProperty(value = "remainingQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal remainingQuantity; + + /* + * This is the total count of instances that are reserved for the + * reservationId. + */ + @JsonProperty(value = "totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal totalReservedQuantity; + + /* + * This is the used quantity for the reservationId. + */ + @JsonProperty(value = "usedQuantity", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal usedQuantity; + + /* + * This is the utilized percentage for the reservation Id. + */ + @JsonProperty(value = "utilizedPercentage", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal utilizedPercentage; + + /** + * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each + * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The + * reservation order specifies the VM size and region for the reservations. + * + * @return the reservationOrderId value. + */ + public String reservationOrderId() { + return this.reservationOrderId; + } + + /** + * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. + * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to + * which the reservation benefit can be applied to. + * + * @return the reservationId value. + */ + public String reservationId() { + return this.reservationId; + } + + /** + * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in + * additional info in usage records. + * + * @return the skuName value. + */ + public String skuName() { + return this.skuName; + } + + /** + * Get the reservedHours property: This is the total hours reserved. E.g. if reservation for 1 instance was made on + * 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. + * + * @return the reservedHours value. + */ + public BigDecimal reservedHours() { + return this.reservedHours; + } + + /** + * Get the usageDate property: Data corresponding to the utilization record. If the grain of data is monthly, it + * will be first day of month. + * + * @return the usageDate value. + */ + public OffsetDateTime usageDate() { + return this.usageDate; + } + + /** + * Get the usedHours property: Total used hours by the reservation. + * + * @return the usedHours value. + */ + public BigDecimal usedHours() { + return this.usedHours; + } + + /** + * Get the minUtilizationPercentage property: This is the minimum hourly utilization in the usage time (day or + * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this + * field will return 10% for that day. + * + * @return the minUtilizationPercentage value. + */ + public BigDecimal minUtilizationPercentage() { + return this.minUtilizationPercentage; + } + + /** + * Get the avgUtilizationPercentage property: This is average utilization for the entire time range. (day or month + * depending on the grain). + * + * @return the avgUtilizationPercentage value. + */ + public BigDecimal avgUtilizationPercentage() { + return this.avgUtilizationPercentage; + } + + /** + * Get the maxUtilizationPercentage property: This is the maximum hourly utilization in the usage time (day or + * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this + * field will return 100% for that day. + * + * @return the maxUtilizationPercentage value. + */ + public BigDecimal maxUtilizationPercentage() { + return this.maxUtilizationPercentage; + } + + /** + * Get the kind property: The reservation kind. + * + * @return the kind value. + */ + public String kind() { + return this.kind; + } + + /** + * Get the purchasedQuantity property: This is the purchased quantity for the reservationId. + * + * @return the purchasedQuantity value. + */ + public BigDecimal purchasedQuantity() { + return this.purchasedQuantity; + } + + /** + * Get the remainingQuantity property: This is the remaining quantity for the reservationId. + * + * @return the remainingQuantity value. + */ + public BigDecimal remainingQuantity() { + return this.remainingQuantity; + } + + /** + * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the + * reservationId. + * + * @return the totalReservedQuantity value. + */ + public BigDecimal totalReservedQuantity() { + return this.totalReservedQuantity; + } + + /** + * Get the usedQuantity property: This is the used quantity for the reservationId. + * + * @return the usedQuantity value. + */ + public BigDecimal usedQuantity() { + return this.usedQuantity; + } + + /** + * Get the utilizedPercentage property: This is the utilized percentage for the reservation Id. + * + * @return the utilizedPercentage value. + */ + public BigDecimal utilizedPercentage() { + return this.utilizedPercentage; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java index c941d11d67f4..1387552b1245 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java @@ -4,8 +4,7 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationTransactionResource; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -15,135 +14,24 @@ import java.util.UUID; /** Reservation transaction resource. */ -@JsonFlatten -@Immutable +@Fluent public class ReservationTransactionInner extends ReservationTransactionResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionInner.class); /* - * The date of the transaction + * The properties of a legacy reservation transaction. */ - @JsonProperty(value = "properties.eventDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime eventDate; + @JsonProperty(value = "properties") + private LegacyReservationTransactionProperties innerProperties; - /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. - */ - @JsonProperty(value = "properties.reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderId; - - /* - * The description of the transaction. - */ - @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * The type of the transaction (Purchase, Cancel, etc.) - */ - @JsonProperty(value = "properties.eventType", access = JsonProperty.Access.WRITE_ONLY) - private String eventType; - - /* - * The quantity of the transaction. - */ - @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal quantity; - - /* - * The charge of the transaction. - */ - @JsonProperty(value = "properties.amount", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal amount; - - /* - * The ISO currency in which the transaction is charged, for example, USD. - */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; - - /* - * The name of the reservation order. - */ - @JsonProperty(value = "properties.reservationOrderName", access = JsonProperty.Access.WRITE_ONLY) - private String reservationOrderName; - - /* - * The purchasing enrollment. - */ - @JsonProperty(value = "properties.purchasingEnrollment", access = JsonProperty.Access.WRITE_ONLY) - private String purchasingEnrollment; - - /* - * The subscription guid that makes the transaction. - */ - @JsonProperty(value = "properties.purchasingSubscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) - private UUID purchasingSubscriptionGuid; - - /* - * The subscription name that makes the transaction. - */ - @JsonProperty(value = "properties.purchasingSubscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String purchasingSubscriptionName; - - /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. - */ - @JsonProperty(value = "properties.armSkuName", access = JsonProperty.Access.WRITE_ONLY) - private String armSkuName; - - /* - * This is the term of the transaction. - */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * The region of the transaction. - */ - @JsonProperty(value = "properties.region", access = JsonProperty.Access.WRITE_ONLY) - private String region; - - /* - * The name of the account that makes the transaction. - */ - @JsonProperty(value = "properties.accountName", access = JsonProperty.Access.WRITE_ONLY) - private String accountName; - - /* - * The email of the account owner that makes the transaction. - */ - @JsonProperty(value = "properties.accountOwnerEmail", access = JsonProperty.Access.WRITE_ONLY) - private String accountOwnerEmail; - - /* - * The department name. - */ - @JsonProperty(value = "properties.departmentName", access = JsonProperty.Access.WRITE_ONLY) - private String departmentName; - - /* - * The cost center of this department if it is a department and a cost - * center is provided. - */ - @JsonProperty(value = "properties.costCenter", access = JsonProperty.Access.WRITE_ONLY) - private String costCenter; - - /* - * The current enrollment. - */ - @JsonProperty(value = "properties.currentEnrollment", access = JsonProperty.Access.WRITE_ONLY) - private String currentEnrollment; - - /* - * The billing frequency, which can be either one-time or recurring. + /** + * Get the innerProperties property: The properties of a legacy reservation transaction. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.billingFrequency", access = JsonProperty.Access.WRITE_ONLY) - private String billingFrequency; + private LegacyReservationTransactionProperties innerProperties() { + return this.innerProperties; + } /** * Get the eventDate property: The date of the transaction. @@ -151,7 +39,7 @@ public class ReservationTransactionInner extends ReservationTransactionResource * @return the eventDate value. */ public OffsetDateTime eventDate() { - return this.eventDate; + return this.innerProperties() == null ? null : this.innerProperties().eventDate(); } /** @@ -162,7 +50,7 @@ public OffsetDateTime eventDate() { * @return the reservationOrderId value. */ public String reservationOrderId() { - return this.reservationOrderId; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderId(); } /** @@ -171,7 +59,7 @@ public String reservationOrderId() { * @return the description value. */ public String description() { - return this.description; + return this.innerProperties() == null ? null : this.innerProperties().description(); } /** @@ -180,7 +68,7 @@ public String description() { * @return the eventType value. */ public String eventType() { - return this.eventType; + return this.innerProperties() == null ? null : this.innerProperties().eventType(); } /** @@ -189,7 +77,7 @@ public String eventType() { * @return the quantity value. */ public BigDecimal quantity() { - return this.quantity; + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** @@ -198,7 +86,7 @@ public BigDecimal quantity() { * @return the amount value. */ public BigDecimal amount() { - return this.amount; + return this.innerProperties() == null ? null : this.innerProperties().amount(); } /** @@ -207,7 +95,7 @@ public BigDecimal amount() { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -216,7 +104,7 @@ public String currency() { * @return the reservationOrderName value. */ public String reservationOrderName() { - return this.reservationOrderName; + return this.innerProperties() == null ? null : this.innerProperties().reservationOrderName(); } /** @@ -225,7 +113,7 @@ public String reservationOrderName() { * @return the purchasingEnrollment value. */ public String purchasingEnrollment() { - return this.purchasingEnrollment; + return this.innerProperties() == null ? null : this.innerProperties().purchasingEnrollment(); } /** @@ -234,7 +122,7 @@ public String purchasingEnrollment() { * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { - return this.purchasingSubscriptionGuid; + return this.innerProperties() == null ? null : this.innerProperties().purchasingSubscriptionGuid(); } /** @@ -243,7 +131,7 @@ public UUID purchasingSubscriptionGuid() { * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { - return this.purchasingSubscriptionName; + return this.innerProperties() == null ? null : this.innerProperties().purchasingSubscriptionName(); } /** @@ -253,7 +141,7 @@ public String purchasingSubscriptionName() { * @return the armSkuName value. */ public String armSkuName() { - return this.armSkuName; + return this.innerProperties() == null ? null : this.innerProperties().armSkuName(); } /** @@ -262,7 +150,7 @@ public String armSkuName() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -271,7 +159,7 @@ public String term() { * @return the region value. */ public String region() { - return this.region; + return this.innerProperties() == null ? null : this.innerProperties().region(); } /** @@ -280,7 +168,7 @@ public String region() { * @return the accountName value. */ public String accountName() { - return this.accountName; + return this.innerProperties() == null ? null : this.innerProperties().accountName(); } /** @@ -289,7 +177,7 @@ public String accountName() { * @return the accountOwnerEmail value. */ public String accountOwnerEmail() { - return this.accountOwnerEmail; + return this.innerProperties() == null ? null : this.innerProperties().accountOwnerEmail(); } /** @@ -298,7 +186,7 @@ public String accountOwnerEmail() { * @return the departmentName value. */ public String departmentName() { - return this.departmentName; + return this.innerProperties() == null ? null : this.innerProperties().departmentName(); } /** @@ -308,7 +196,7 @@ public String departmentName() { * @return the costCenter value. */ public String costCenter() { - return this.costCenter; + return this.innerProperties() == null ? null : this.innerProperties().costCenter(); } /** @@ -317,7 +205,7 @@ public String costCenter() { * @return the currentEnrollment value. */ public String currentEnrollment() { - return this.currentEnrollment; + return this.innerProperties() == null ? null : this.innerProperties().currentEnrollment(); } /** @@ -326,7 +214,7 @@ public String currentEnrollment() { * @return the billingFrequency value. */ public String billingFrequency() { - return this.billingFrequency; + return this.innerProperties() == null ? null : this.innerProperties().billingFrequency(); } /** @@ -337,5 +225,8 @@ public String billingFrequency() { @Override public void validate() { super.validate(); + if (innerProperties() != null) { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java new file mode 100644 index 000000000000..c38afadca36c --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.models.Tag; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** The properties of the tag. */ +@Fluent +public final class TagProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TagProperties.class); + + /* + * A list of Tag. + */ + @JsonProperty(value = "tags") + private List tags; + + /* + * The link (url) to the next page of results. + */ + @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) + private String nextLink; + + /* + * The link (url) to the previous page of results. + */ + @JsonProperty(value = "previousLink", access = JsonProperty.Access.WRITE_ONLY) + private String previousLink; + + /** + * Get the tags property: A list of Tag. + * + * @return the tags value. + */ + public List tags() { + return this.tags; + } + + /** + * Set the tags property: A list of Tag. + * + * @param tags the tags value to set. + * @return the TagProperties object itself. + */ + public TagProperties withTags(List tags) { + this.tags = tags; + 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; + } + + /** + * Get the previousLink property: The link (url) to the previous page of results. + * + * @return the previousLink value. + */ + public String previousLink() { + return this.previousLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (tags() != null) { + tags().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java index 2ab865eeb918..2cd3f869d8e8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.JsonFlatten; import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Tag; @@ -14,28 +13,15 @@ import java.util.List; /** A resource listing all tags. */ -@JsonFlatten @Fluent -public class TagsResultInner extends ProxyResource { +public final class TagsResultInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResultInner.class); /* - * A list of Tag. + * The properties of the tag. */ - @JsonProperty(value = "properties.tags") - private List tags; - - /* - * The link (url) to the next page of results. - */ - @JsonProperty(value = "properties.nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /* - * The link (url) to the previous page of results. - */ - @JsonProperty(value = "properties.previousLink", access = JsonProperty.Access.WRITE_ONLY) - private String previousLink; + @JsonProperty(value = "properties") + private TagProperties innerProperties; /* * eTag of the resource. To handle concurrent update scenario, this field @@ -45,13 +31,44 @@ public class TagsResultInner extends ProxyResource { @JsonProperty(value = "eTag") private String etag; + /** + * Get the innerProperties property: The properties of the tag. + * + * @return the innerProperties value. + */ + private TagProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param etag the etag value to set. + * @return the TagsResultInner object itself. + */ + public TagsResultInner withEtag(String etag) { + this.etag = etag; + return this; + } + /** * Get the tags property: A list of Tag. * * @return the tags value. */ public List tags() { - return this.tags; + return this.innerProperties() == null ? null : this.innerProperties().tags(); } /** @@ -61,7 +78,10 @@ public List tags() { * @return the TagsResultInner object itself. */ public TagsResultInner withTags(List tags) { - this.tags = tags; + if (this.innerProperties() == null) { + this.innerProperties = new TagProperties(); + } + this.innerProperties().withTags(tags); return this; } @@ -71,7 +91,7 @@ public TagsResultInner withTags(List tags) { * @return the nextLink value. */ public String nextLink() { - return this.nextLink; + return this.innerProperties() == null ? null : this.innerProperties().nextLink(); } /** @@ -80,29 +100,7 @@ public String nextLink() { * @return the previousLink value. */ public String previousLink() { - return this.previousLink; - } - - /** - * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @param etag the etag value to set. - * @return the TagsResultInner object itself. - */ - public TagsResultInner withEtag(String etag) { - this.etag = etag; - return this; + return this.innerProperties() == null ? null : this.innerProperties().previousLink(); } /** @@ -111,8 +109,8 @@ public TagsResultInner withEtag(String etag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (tags() != null) { - tags().forEach(e -> e.validate()); + if (innerProperties() != null) { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java index 1a8de7e134bb..97647be02c10 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.consumption.models.LegacyUsageDetail; import com.azure.resourcemanager.consumption.models.ModernUsageDetail; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -32,7 +33,7 @@ public class UsageDetailInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailInner.class); /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -41,10 +42,11 @@ public class UsageDetailInner extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java index 25ab450d9ca1..c241892a5f74 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java @@ -71,7 +71,7 @@ Mono> getByManagementGroup( @Headers({"Content-Type: application/json"}) @Get( "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing" - + "/billingPeriods/{billingPeriodName}/Microsoft.Consumption/aggregatedCost") + + "/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getForBillingPeriodByManagementGroup( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java index 69fcabe9946a..2f73babf5e6d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java @@ -36,6 +36,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String currency() { return this.innerModel().currency(); } @@ -106,19 +119,6 @@ public List adjustmentDetails() { } } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public BalanceInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesClientImpl.java index 142543f3d1a7..f92addf51bff 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesClientImpl.java @@ -66,8 +66,8 @@ Mono> getByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}" - + "/providers/Microsoft.Consumption/balances") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Billing/billingPeriods" + + "/{billingPeriodName}/providers/Microsoft.Consumption/balances") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getForBillingPeriodByBillingAccount( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java index 0200703884b7..e75cd7f54bd9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java @@ -35,6 +35,10 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + public CategoryType category() { return this.innerModel().category(); } @@ -72,10 +76,6 @@ public ForecastSpend forecastSpend() { return this.innerModel().forecastSpend(); } - public String etag() { - return this.innerModel().etag(); - } - public BudgetInner innerModel() { return this.innerObject; } @@ -168,6 +168,11 @@ public Budget refresh(Context context) { return this; } + public BudgetImpl withEtag(String etag) { + this.innerModel().withEtag(etag); + return this; + } + public BudgetImpl withCategory(CategoryType category) { this.innerModel().withCategory(category); return this; @@ -197,9 +202,4 @@ public BudgetImpl withNotifications(Map notifications) { this.innerModel().withNotifications(notifications); return this; } - - public BudgetImpl withEtag(String etag) { - this.innerModel().withEtag(etag); - return this; - } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java index 051fbfcaf5ff..d4a20bf01a4c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java @@ -28,7 +28,6 @@ import com.azure.resourcemanager.consumption.fluent.ConsumptionManagementClient; import com.azure.resourcemanager.consumption.fluent.CreditsClient; import com.azure.resourcemanager.consumption.fluent.EventsOperationsClient; -import com.azure.resourcemanager.consumption.fluent.ForecastsClient; import com.azure.resourcemanager.consumption.fluent.LotsOperationsClient; import com.azure.resourcemanager.consumption.fluent.MarketplacesClient; import com.azure.resourcemanager.consumption.fluent.OperationsClient; @@ -271,18 +270,6 @@ public PriceSheetsClient getPriceSheets() { return this.priceSheets; } - /** The ForecastsClient object to access its operations. */ - private final ForecastsClient forecasts; - - /** - * Gets the ForecastsClient object to access its operations. - * - * @return the ForecastsClient object. - */ - public ForecastsClient getForecasts() { - return this.forecasts; - } - /** The OperationsClient object to access its operations. */ private final OperationsClient operations; @@ -365,7 +352,7 @@ public CreditsClient getCredits() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-10-01"; + this.apiVersion = "2021-10-01"; this.usageDetails = new UsageDetailsClientImpl(this); this.marketplaces = new MarketplacesClientImpl(this); this.budgets = new BudgetsClientImpl(this); @@ -378,7 +365,6 @@ public CreditsClient getCredits() { this.reservationRecommendationDetails = new ReservationRecommendationDetailsClientImpl(this); this.reservationTransactions = new ReservationTransactionsClientImpl(this); this.priceSheets = new PriceSheetsClientImpl(this); - this.forecasts = new ForecastsClientImpl(this); this.operations = new OperationsClientImpl(this); this.aggregatedCosts = new AggregatedCostsClientImpl(this); this.eventsOperations = new EventsOperationsClientImpl(this); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java index cbb44865671d..b82df9ee09f2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java @@ -35,12 +35,17 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); + public String etag() { + return this.innerModel().etag(); } - public String billingCurrency() { - return this.innerModel().billingCurrency(); + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public CreditBalanceSummary balanceSummary() { @@ -59,21 +64,20 @@ public Amount pendingEligibleCharges() { return this.innerModel().pendingEligibleCharges(); } - public Reseller reseller() { - return this.innerModel().reseller(); + public String creditCurrency() { + return this.innerModel().creditCurrency(); } - public String etag() { - return this.innerModel().etag(); + public String billingCurrency() { + return this.innerModel().billingCurrency(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public Reseller reseller() { + return this.innerModel().reseller(); + } + + public String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); } public CreditSummaryInner innerModel() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java index 8b07b5f2a405..0167b867175e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsClientImpl.java @@ -54,13 +54,16 @@ public final class CreditsClientImpl implements CreditsClient { @ServiceInterface(name = "ConsumptionManagemen") private interface CreditsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/credits/balanceSummary") - @ExpectedResponses({200}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/credits/balanceSummary") + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, @HeaderParam("Accept") String accept, Context context); } @@ -68,42 +71,49 @@ Mono> get( /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope) { + private Mono> getWithResponseAsync(String billingAccountId, String billingProfileId) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context)) + context -> + service + .get( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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. @@ -111,37 +121,47 @@ private Mono> getWithResponseAsync(String scope) { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String scope, Context context) { + private Mono> getWithResponseAsync( + String billingAccountId, String billingProfileId, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), scope, accept, context); + return service + .get( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String scope) { - return getWithResponseAsync(scope) + private Mono getAsync(String billingAccountId, String billingProfileId) { + return getWithResponseAsync(billingAccountId, billingProfileId) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -155,29 +175,23 @@ private Mono getAsync(String scope) { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CreditSummaryInner get(String scope) { - return getAsync(scope).block(); + public CreditSummaryInner get(String billingAccountId, String billingProfileId) { + return getAsync(billingAccountId, billingProfileId).block(); } /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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. @@ -185,7 +199,8 @@ public CreditSummaryInner get(String scope) { * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, Context context) { - return getWithResponseAsync(scope, context).block(); + public Response getWithResponse( + String billingAccountId, String billingProfileId, Context context) { + return getWithResponseAsync(billingAccountId, billingProfileId, context).block(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java index 4c8225371d27..0a36ba8d42d2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditsImpl.java @@ -27,8 +27,8 @@ public CreditsImpl( this.serviceManager = serviceManager; } - public CreditSummary get(String scope) { - CreditSummaryInner inner = this.serviceClient().get(scope); + public CreditSummary get(String billingAccountId, String billingProfileId) { + CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); if (inner != null) { return new CreditSummaryImpl(inner, this.manager()); } else { @@ -36,8 +36,9 @@ public CreditSummary get(String scope) { } } - public Response getWithResponse(String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, context); + public Response getWithResponse(String billingAccountId, String billingProfileId, Context context) { + Response inner = + this.serviceClient().getWithResponse(billingAccountId, billingProfileId, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java index 5c83cf6e85e6..a5a471c6c79a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java @@ -37,12 +37,17 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); + public String etag() { + return this.innerModel().etag(); } - public String billingCurrency() { - return this.innerModel().billingCurrency(); + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public OffsetDateTime transactionDate() { @@ -57,42 +62,22 @@ public Amount newCredit() { return this.innerModel().newCredit(); } - public AmountWithExchangeRate newCreditInBillingCurrency() { - return this.innerModel().newCreditInBillingCurrency(); - } - public Amount adjustments() { return this.innerModel().adjustments(); } - public AmountWithExchangeRate adjustmentsInBillingCurrency() { - return this.innerModel().adjustmentsInBillingCurrency(); - } - public Amount creditExpired() { return this.innerModel().creditExpired(); } - public AmountWithExchangeRate creditExpiredInBillingCurrency() { - return this.innerModel().creditExpiredInBillingCurrency(); - } - public Amount charges() { return this.innerModel().charges(); } - public AmountWithExchangeRate chargesInBillingCurrency() { - return this.innerModel().chargesInBillingCurrency(); - } - public Amount closedBalance() { return this.innerModel().closedBalance(); } - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.innerModel().closedBalanceInBillingCurrency(); - } - public EventType eventType() { return this.innerModel().eventType(); } @@ -101,21 +86,60 @@ public String invoiceNumber() { return this.innerModel().invoiceNumber(); } + public String billingProfileId() { + return this.innerModel().billingProfileId(); + } + + public String billingProfileDisplayName() { + return this.innerModel().billingProfileDisplayName(); + } + + public String lotId() { + return this.innerModel().lotId(); + } + + public String lotSource() { + return this.innerModel().lotSource(); + } + + public Amount canceledCredit() { + return this.innerModel().canceledCredit(); + } + + public String creditCurrency() { + return this.innerModel().creditCurrency(); + } + + public String billingCurrency() { + return this.innerModel().billingCurrency(); + } + public Reseller reseller() { return this.innerModel().reseller(); } - public String etag() { - return this.innerModel().etag(); + public AmountWithExchangeRate creditExpiredInBillingCurrency() { + return this.innerModel().creditExpiredInBillingCurrency(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public AmountWithExchangeRate newCreditInBillingCurrency() { + return this.innerModel().newCreditInBillingCurrency(); + } + + public AmountWithExchangeRate adjustmentsInBillingCurrency() { + return this.innerModel().adjustmentsInBillingCurrency(); + } + + public AmountWithExchangeRate chargesInBillingCurrency() { + return this.innerModel().chargesInBillingCurrency(); + } + + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.innerModel().closedBalanceInBillingCurrency(); + } + + public String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); } public EventSummaryInner innerModel() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java index 651c111d20c9..669bd221ad8d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsClientImpl.java @@ -60,15 +60,40 @@ public final class EventsOperationsClientImpl implements EventsOperationsClient @ServiceInterface(name = "ConsumptionManagemen") private interface EventsOperationsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/events") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/events") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, - @PathParam(value = "scope", encoded = true) String scope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @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); @@ -76,7 +101,7 @@ Mono> list( @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + Mono> listByBillingAccountNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, @@ -84,48 +109,53 @@ Mono> listNext( } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String startDate, String endDate, String scope) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } if (startDate == null) { return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); } if (endDate == null) { return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list( + .listByBillingProfile( this.client.getEndpoint(), + billingAccountId, + billingProfileId, this.client.getApiVersion(), startDate, endDate, - scope, accept, context)) .>map( @@ -141,15 +171,13 @@ private Mono> listSinglePageAsync(String startD } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. @@ -157,27 +185,40 @@ private Mono> listSinglePageAsync(String startD * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String startDate, String endDate, String scope, Context context) { + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } if (startDate == null) { return Mono.error(new IllegalArgumentException("Parameter startDate is required and cannot be null.")); } if (endDate == null) { return Mono.error(new IllegalArgumentException("Parameter endDate is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), startDate, endDate, scope, accept, context) + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + startDate, + endDate, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -190,36 +231,34 @@ private Mono> listSinglePageAsync( } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String startDate, String endDate, String scope) { + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate) { return new PagedFlux<>( - () -> listSinglePageAsync(startDate, endDate, scope), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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. @@ -227,42 +266,40 @@ private PagedFlux listAsync(String startDate, String endDate, * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String startDate, String endDate, String scope, Context context) { + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(startDate, endDate, scope, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String startDate, String endDate, String scope) { - return new PagedIterable<>(listAsync(startDate, endDate, scope)); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate)); } /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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 +307,199 @@ public PagedIterable list(String startDate, String endDate, S * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String startDate, String endDate, String scope, Context context) { - return new PagedIterable<>(listAsync(startDate, endDate, scope, context)); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + return new PagedIterable<>( + listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate, context)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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 result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + filter, + 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 events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingAccount( + this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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 result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId) { + final String filter = null; + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync( + String billingAccountId, String filter, Context context) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount(String billingAccountId) { + final String filter = null; + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter)); + } + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing event summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingAccount( + String billingAccountId, String filter, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter, context)); } /** @@ -284,7 +512,7 @@ public PagedIterable list(String startDate, String endDate, S * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -296,7 +524,81 @@ private Mono> listNextSinglePageAsync(String ne } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .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 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 event summary. + */ + @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 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 event summary. + */ + @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<>( @@ -320,7 +622,8 @@ private Mono> listNextSinglePageAsync(String ne * @return result of listing event summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -333,7 +636,7 @@ private Mono> listNextSinglePageAsync(String ne final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java index 994c73b9cf0e..4e5f0b2bd8f4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java @@ -26,13 +26,28 @@ public EventsOperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String startDate, String endDate, String scope) { - PagedIterable inner = this.serviceClient().list(startDate, endDate, scope); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate); return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String startDate, String endDate, String scope, Context context) { - PagedIterable inner = this.serviceClient().list(startDate, endDate, scope, context); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate, context); + return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); + return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountId, filter, context); return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastImpl.java deleted file mode 100644 index 949b21bb2309..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastImpl.java +++ /dev/null @@ -1,88 +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.consumption.implementation; - -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; -import com.azure.resourcemanager.consumption.models.ChargeType; -import com.azure.resourcemanager.consumption.models.Forecast; -import com.azure.resourcemanager.consumption.models.ForecastPropertiesConfidenceLevelsItem; -import com.azure.resourcemanager.consumption.models.Grain; -import java.math.BigDecimal; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class ForecastImpl implements Forecast { - private ForecastInner innerObject; - - private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - - ForecastImpl(ForecastInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager 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 usageDate() { - return this.innerModel().usageDate(); - } - - public Grain grain() { - return this.innerModel().grain(); - } - - public BigDecimal charge() { - return this.innerModel().charge(); - } - - public String currency() { - return this.innerModel().currency(); - } - - public ChargeType chargeType() { - return this.innerModel().chargeType(); - } - - public List confidenceLevels() { - List inner = this.innerModel().confidenceLevels(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public ForecastInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.consumption.ConsumptionManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsClientImpl.java deleted file mode 100644 index 8eff9ef4c18a..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsClientImpl.java +++ /dev/null @@ -1,250 +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.consumption.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.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.fluent.ForecastsClient; -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; -import com.azure.resourcemanager.consumption.models.ForecastsListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ForecastsClient. */ -public final class ForecastsClientImpl implements ForecastsClient { - private final ClientLogger logger = new ClientLogger(ForecastsClientImpl.class); - - /** The proxy service used to perform REST calls. */ - private final ForecastsService service; - - /** The service client containing this operation class. */ - private final ConsumptionManagementClientImpl client; - - /** - * Initializes an instance of ForecastsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ForecastsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(ForecastsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ConsumptionManagementClientForecasts to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ConsumptionManagemen") - private interface ForecastsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/forecasts") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 forecasts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter) { - 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 accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @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 forecasts. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String filter, 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 accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(filter)); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @throws 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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(filter)); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String filter, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(filter, context)); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @throws 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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final String filter = null; - return new PagedIterable<>(listAsync(filter)); - } - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @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 forecasts. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String filter, Context context) { - return new PagedIterable<>(listAsync(filter, context)); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsImpl.java deleted file mode 100644 index 81189c8ce7bb..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ForecastsImpl.java +++ /dev/null @@ -1,46 +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.consumption.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.fluent.ForecastsClient; -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; -import com.azure.resourcemanager.consumption.models.Forecast; -import com.azure.resourcemanager.consumption.models.Forecasts; -import com.fasterxml.jackson.annotation.JsonIgnore; - -public final class ForecastsImpl implements Forecasts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ForecastsImpl.class); - - private final ForecastsClient innerClient; - - private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - - public ForecastsImpl( - ForecastsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ForecastImpl(inner1, this.manager())); - } - - public PagedIterable list(String filter, Context context) { - PagedIterable inner = this.serviceClient().list(filter, context); - return Utils.mapPage(inner, inner1 -> new ForecastImpl(inner1, this.manager())); - } - - private ForecastsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.consumption.ConsumptionManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java index 0c55e93f5bfd..596c760a09d1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java @@ -10,6 +10,7 @@ import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.LotSummary; import com.azure.resourcemanager.consumption.models.Reseller; +import com.azure.resourcemanager.consumption.models.Status; import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -37,30 +38,27 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); + public String etag() { + return this.innerModel().etag(); } - public String billingCurrency() { - return this.innerModel().billingCurrency(); + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } } public Amount originalAmount() { return this.innerModel().originalAmount(); } - public AmountWithExchangeRate originalAmountInBillingCurrency() { - return this.innerModel().originalAmountInBillingCurrency(); - } - public Amount closedBalance() { return this.innerModel().closedBalance(); } - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.innerModel().closedBalanceInBillingCurrency(); - } - public LotSource source() { return this.innerModel().source(); } @@ -77,21 +75,36 @@ public String poNumber() { return this.innerModel().poNumber(); } - public Reseller reseller() { - return this.innerModel().reseller(); + public OffsetDateTime purchasedDate() { + return this.innerModel().purchasedDate(); } - public String etag() { - return this.innerModel().etag(); + public Status status() { + return this.innerModel().status(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } + public String creditCurrency() { + return this.innerModel().creditCurrency(); + } + + public String billingCurrency() { + return this.innerModel().billingCurrency(); + } + + public AmountWithExchangeRate originalAmountInBillingCurrency() { + return this.innerModel().originalAmountInBillingCurrency(); + } + + public AmountWithExchangeRate closedBalanceInBillingCurrency() { + return this.innerModel().closedBalanceInBillingCurrency(); + } + + public Reseller reseller() { + return this.innerModel().reseller(); + } + + public String etagPropertiesEtag() { + return this.innerModel().etagPropertiesEtag(); } public LotSummaryInner innerModel() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java index dedeaeaec1b9..e17ef7138dbc 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java @@ -60,55 +60,264 @@ public final class LotsOperationsClientImpl implements LotsOperationsClient { @ServiceInterface(name = "ConsumptionManagemen") private interface LotsOperationsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/lots") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/lots") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( + Mono> listByBillingProfile( @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByBillingAccount( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( + 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); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 lot summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + 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 all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @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 lot summary. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByBillingProfileSinglePageAsync( + String billingAccountId, String billingProfileId, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingProfileId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingProfileId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByBillingProfile( + this.client.getEndpoint(), + billingAccountId, + billingProfileId, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingProfileAsync( + String billingAccountId, String billingProfileId, Context context) { + return new PagedFlux<>( + () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, context), + nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. + * @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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context) { + return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, context)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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 result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( - context -> service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) + context -> + service + .listByBillingAccount( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + filter, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -122,13 +331,13 @@ private Mono> listSinglePageAsync(String scope) { } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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. @@ -136,20 +345,23 @@ private Mono> listSinglePageAsync(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, Context context) { + private Mono> listByBillingAccountSinglePageAsync( + String billingAccountId, String filter, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (scope == null) { - return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context) + .listByBillingAccount( + this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) .map( res -> new PagedResponseBase<>( @@ -162,31 +374,51 @@ private Mono> listSinglePageAsync(String scope, C } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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 result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { - return new PagedFlux<>(() -> listSinglePageAsync(scope), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 lot summary. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByBillingAccountAsync(String billingAccountId) { + final String filter = null; + return new PagedFlux<>( + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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. @@ -194,37 +426,37 @@ private PagedFlux listAsync(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Context context) { + private PagedFlux listByBillingAccountAsync( + String billingAccountId, String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { - return new PagedIterable<>(listAsync(scope)); + public PagedIterable listByBillingAccount(String billingAccountId) { + final String filter = null; + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter)); } /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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. @@ -232,8 +464,9 @@ public PagedIterable list(String scope) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Context context) { - return new PagedIterable<>(listAsync(scope, context)); + public PagedIterable listByBillingAccount( + String billingAccountId, String filter, Context context) { + return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter, context)); } /** @@ -246,7 +479,7 @@ public PagedIterable list(String scope, Context context) { * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -258,7 +491,81 @@ private Mono> listNextSinglePageAsync(String next } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .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 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 lot summary. + */ + @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 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 lot summary. + */ + @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<>( @@ -282,7 +589,8 @@ private Mono> listNextSinglePageAsync(String next * @return result of listing lot summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync( + String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -295,7 +603,7 @@ private Mono> listNextSinglePageAsync(String next final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) + .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) .map( res -> new PagedResponseBase<>( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java index 6f5608863259..82f0b140a011 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsImpl.java @@ -26,13 +26,27 @@ public LotsOperationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Context context) { - PagedIterable inner = this.serviceClient().list(scope, context); + public PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, context); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId) { + PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByBillingAccount(billingAccountId, filter, context); return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java index 79496ededcbd..8ea750f2cf16 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java @@ -37,6 +37,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String billingPeriodId() { return this.innerModel().billingPeriodId(); } @@ -97,19 +110,6 @@ public List excludedSubscriptions() { } } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ManagementGroupAggregatedCostResultInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java index 033df3875bd3..cd69589cad40 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java @@ -35,6 +35,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String billingPeriodId() { return this.innerModel().billingPeriodId(); } @@ -139,19 +152,6 @@ public Boolean isRecurringCharge() { return this.innerModel().isRecurringCharge(); } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public MarketplaceInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java index 7fcefd16fe92..0ebe7ef97d38 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java @@ -35,6 +35,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public List pricesheets() { List inner = this.innerModel().pricesheets(); if (inner != null) { @@ -52,19 +65,6 @@ public MeterDetails download() { return this.innerModel().download(); } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public PriceSheetResultInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java index 8cb5b5a5053a..e01c7433932a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java @@ -87,8 +87,7 @@ Mono> getByBillingPeriod( } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -99,7 +98,7 @@ Mono> getByBillingPeriod( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String expand, String skiptoken, Integer top) { @@ -133,8 +132,7 @@ private Mono> getWithResponseAsync(String expand } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -146,7 +144,7 @@ private Mono> getWithResponseAsync(String expand * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -178,8 +176,7 @@ private Mono> getWithResponseAsync( } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -190,7 +187,7 @@ private Mono> getWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String expand, String skiptoken, Integer top) { @@ -206,12 +203,11 @@ private Mono getAsync(String expand, String skiptoken, In } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync() { @@ -230,12 +226,11 @@ private Mono getAsync() { } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) public PriceSheetResultInner get() { @@ -246,8 +241,7 @@ public PriceSheetResultInner get() { } /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -259,7 +253,7 @@ public PriceSheetResultInner get() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java index 9429325b8f48..62cc2ebaf7ad 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java @@ -34,6 +34,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String reservationOrderId() { return this.innerModel().reservationOrderId(); } @@ -78,19 +91,6 @@ public String kind() { return this.innerModel().kind(); } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ReservationDetailInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java index 57dcfac6d6fa..309f8e08f003 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.resourcemanager.consumption.fluent.ReservationRecommendationDetailsClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner; import com.azure.resourcemanager.consumption.models.LookBackPeriod; -import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; import reactor.core.publisher.Mono; @@ -64,14 +63,13 @@ public final class ReservationRecommendationDetailsClientImpl implements Reserva @ServiceInterface(name = "ConsumptionManagemen") private interface ReservationRecommendationDetailsService { @Headers({"Content-Type: application/json"}) - @Get("/{billingScope}/providers/Microsoft.Consumption/reservationRecommendationDetails") + @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "billingScope", encoded = true) String billingScope, - @QueryParam("scope") Scope scope, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("region") String region, @QueryParam("term") Term term, @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, @@ -83,13 +81,12 @@ Mono> get( /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -102,16 +99,13 @@ Mono> get( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } @@ -135,7 +129,6 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, region, term, @@ -149,13 +142,12 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -169,22 +161,13 @@ private Mono> getWithRespon */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, - Scope scope, - String region, - Term term, - LookBackPeriod lookBackPeriod, - String product, - Context context) { + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (billingScope == null) { - return Mono.error(new IllegalArgumentException("Parameter billingScope is required and cannot be null.")); - } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } @@ -206,7 +189,6 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, region, term, @@ -219,13 +201,12 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -238,8 +219,8 @@ private Mono> getWithRespon */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getWithResponseAsync(billingScope, scope, region, term, lookBackPeriod, product) + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getWithResponseAsync(scope, region, term, lookBackPeriod, product) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -253,13 +234,12 @@ private Mono getAsync( /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -272,20 +252,19 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationRecommendationDetailsModelInner get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getAsync(billingScope, scope, region, term, lookBackPeriod, product).block(); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getAsync(scope, region, term, lookBackPeriod, product).block(); } /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -299,13 +278,7 @@ public ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String billingScope, - Scope scope, - String region, - Term term, - LookBackPeriod lookBackPeriod, - String product, - Context context) { - return getWithResponseAsync(billingScope, scope, region, term, lookBackPeriod, product, context).block(); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { + return getWithResponseAsync(scope, region, term, lookBackPeriod, product, context).block(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java index 941057acdb82..1116ec92642f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java @@ -13,7 +13,6 @@ import com.azure.resourcemanager.consumption.models.LookBackPeriod; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetails; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsModel; -import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -32,9 +31,9 @@ public ReservationRecommendationDetailsImpl( } public ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { ReservationRecommendationDetailsModelInner inner = - this.serviceClient().get(billingScope, scope, region, term, lookBackPeriod, product); + this.serviceClient().get(scope, region, term, lookBackPeriod, product); if (inner != null) { return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); } else { @@ -43,15 +42,9 @@ public ReservationRecommendationDetailsModel get( } public Response getWithResponse( - String billingScope, - Scope scope, - String region, - Term term, - LookBackPeriod lookBackPeriod, - String product, - Context context) { + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { Response inner = - this.serviceClient().getWithResponse(billingScope, scope, region, term, lookBackPeriod, product, context); + this.serviceClient().getWithResponse(scope, region, term, lookBackPeriod, product, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java index 2a0cabf335ad..b60aeda8444c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java @@ -48,6 +48,15 @@ public String etag() { return this.innerModel().etag(); } + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String currency() { return this.innerModel().currency(); } @@ -72,15 +81,6 @@ public ReservationRecommendationDetailsUsageProperties usage() { return this.innerModel().usage(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ReservationRecommendationDetailsModelInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java index 354e8fa72acf..6f2667181453 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java @@ -21,12 +21,16 @@ public final class ReservationRecommendationImpl implements ReservationRecommend this.serviceManager = serviceManager; } - public String location() { - return this.innerModel().location(); + public String id() { + return this.innerModel().id(); } - public String sku() { - return this.innerModel().sku(); + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); } public String etag() { @@ -42,6 +46,14 @@ public Map tags() { } } + public String location() { + return this.innerModel().location(); + } + + public String sku() { + return this.innerModel().sku(); + } + public ReservationRecommendationInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java index 60f2a6af937b..6db8470ede12 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java @@ -34,6 +34,19 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + + public Map tags() { + Map inner = this.innerModel().tags(); + if (inner != null) { + return Collections.unmodifiableMap(inner); + } else { + return Collections.emptyMap(); + } + } + public String reservationOrderId() { return this.innerModel().reservationOrderId(); } @@ -94,19 +107,6 @@ public BigDecimal utilizedPercentage() { return this.innerModel().utilizedPercentage(); } - public String etag() { - return this.innerModel().etag(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public ReservationSummaryInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java index cee8f77d27cd..18b19328a4ed 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java @@ -565,10 +565,10 @@ public PagedIterable listByReservationOrderAndReservati * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific @@ -636,10 +636,10 @@ private Mono> listSinglePageAsync( * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific @@ -706,10 +706,10 @@ private Mono> listSinglePageAsync( * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific @@ -766,10 +766,10 @@ private PagedFlux listAsync(String scope, Datagrain gra * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific @@ -829,10 +829,10 @@ public PagedIterable list(String scope, Datagrain grain * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java index 77a6bebab914..684410f228bf 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java @@ -33,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public String etag() { + return this.innerModel().etag(); + } + public List tags() { List inner = this.innerModel().tags(); if (inner != null) { @@ -50,10 +54,6 @@ public String previousLink() { return this.innerModel().previousLink(); } - public String etag() { - return this.innerModel().etag(); - } - public TagsResultInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java index 3c621b748ee1..44a113317cd0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java @@ -89,8 +89,7 @@ Mono> listNext( /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -111,7 +110,7 @@ Mono> listNext( * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter @@ -168,8 +167,7 @@ private Mono> listSinglePageAsync( /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -190,7 +188,7 @@ private Mono> listSinglePageAsync( * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter @@ -245,8 +243,7 @@ private Mono> listSinglePageAsync( /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -267,7 +264,7 @@ private Mono> listSinglePageAsync( * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter @@ -292,8 +289,7 @@ private PagedFlux listAsync( /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -331,8 +327,7 @@ private PagedFlux listAsync(String scope) { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -353,7 +348,7 @@ private PagedFlux listAsync(String scope) { * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter @@ -379,8 +374,7 @@ private PagedFlux listAsync( /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -416,8 +410,7 @@ public PagedIterable list(String scope) { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -438,7 +431,7 @@ public PagedIterable list(String scope) { * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java index 494127f9432c..56359257ad74 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java @@ -10,25 +10,25 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; -/** Reseller details. */ +/** The amount with exchange rate. */ @Immutable public final class AmountWithExchangeRate extends Amount { @JsonIgnore private final ClientLogger logger = new ClientLogger(AmountWithExchangeRate.class); /* - * Exchange Rate. + * The exchange rate. */ @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal exchangeRate; /* - * Exchange rate month. + * The exchange rate month. */ @JsonProperty(value = "exchangeRateMonth", access = JsonProperty.Access.WRITE_ONLY) - private Float exchangeRateMonth; + private Integer exchangeRateMonth; /** - * Get the exchangeRate property: Exchange Rate. + * Get the exchangeRate property: The exchange rate. * * @return the exchangeRate value. */ @@ -37,11 +37,11 @@ public BigDecimal exchangeRate() { } /** - * Get the exchangeRateMonth property: Exchange rate month. + * Get the exchangeRateMonth property: The exchange rate month. * * @return the exchangeRateMonth value. */ - public Float exchangeRateMonth() { + public Integer exchangeRateMonth() { return this.exchangeRateMonth; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java index 62a70684dccb..05ffe918298a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java @@ -32,6 +32,20 @@ public interface Balance { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the currency property: The ISO currency in which the meter is charged, for example, USD. * @@ -138,20 +152,6 @@ public interface Balance { */ List adjustmentDetails(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.BalanceInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Bound.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Bound.java deleted file mode 100644 index a96a769a96ae..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Bound.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.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Bound. */ -public final class Bound extends ExpandableStringEnum { - /** Static value Upper for Bound. */ - public static final Bound UPPER = fromString("Upper"); - - /** Static value Lower for Bound. */ - public static final Bound LOWER = fromString("Lower"); - - /** - * Creates or finds a Bound from its string representation. - * - * @param name a name to look for. - * @return the corresponding Bound. - */ - @JsonCreator - public static Bound fromString(String name) { - return fromString(name, Bound.class); - } - - /** @return known Bound values. */ - public static Collection values() { - return values(Bound.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java index c8f73e1d0bb0..125f395964b8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java @@ -32,6 +32,14 @@ public interface Budget { */ String type(); + /** + * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + String etag(); + /** * Gets the category property: The category of the budget, whether the budget tracks cost or usage. * @@ -93,14 +101,6 @@ public interface Budget { */ ForecastSpend forecastSpend(); - /** - * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @return the etag value. - */ - String etag(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.BudgetInner object. * @@ -143,13 +143,13 @@ interface WithScope { * created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithCategory, + extends DefinitionStages.WithEtag, + DefinitionStages.WithCategory, DefinitionStages.WithAmount, DefinitionStages.WithTimeGrain, DefinitionStages.WithTimePeriod, DefinitionStages.WithFilter, - DefinitionStages.WithNotifications, - DefinitionStages.WithEtag { + DefinitionStages.WithNotifications { /** * Executes the create request. * @@ -165,6 +165,18 @@ interface WithCreate */ Budget create(Context context); } + /** The stage of the Budget definition allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will + * be used to determine whether the user is updating the latest version or not.. + * + * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * @return the next definition stage. + */ + WithCreate withEtag(String etag); + } /** The stage of the Budget definition allowing to specify category. */ interface WithCategory { /** @@ -236,18 +248,6 @@ interface WithNotifications { */ WithCreate withNotifications(Map notifications); } - /** The stage of the Budget definition allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will - * be used to determine whether the user is updating the latest version or not.. - * - * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * @return the next definition stage. - */ - WithCreate withEtag(String etag); - } } /** * Begins update for the Budget resource. @@ -258,13 +258,13 @@ interface WithEtag { /** The template for Budget update. */ interface Update - extends UpdateStages.WithCategory, + extends UpdateStages.WithEtag, + UpdateStages.WithCategory, UpdateStages.WithAmount, UpdateStages.WithTimeGrain, UpdateStages.WithTimePeriod, UpdateStages.WithFilter, - UpdateStages.WithNotifications, - UpdateStages.WithEtag { + UpdateStages.WithNotifications { /** * Executes the update request. * @@ -282,6 +282,18 @@ interface Update } /** The Budget update stages. */ interface UpdateStages { + /** The stage of the Budget update allowing to specify etag. */ + interface WithEtag { + /** + * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will + * be used to determine whether the user is updating the latest version or not.. + * + * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * @return the next definition stage. + */ + Update withEtag(String etag); + } /** The stage of the Budget update allowing to specify category. */ interface WithCategory { /** @@ -353,18 +365,6 @@ interface WithNotifications { */ Update withNotifications(Map notifications); } - /** The stage of the Budget update allowing to specify etag. */ - interface WithEtag { - /** - * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will - * be used to determine whether the user is updating the latest version or not.. - * - * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * @return the next definition stage. - */ - Update withEtag(String etag); - } } /** * Refreshes the resource to sync with Azure. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java index 18d50dd1e9f3..5ab80f5b9729 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java @@ -8,6 +8,7 @@ import com.azure.core.management.ProxyResource; import com.azure.core.util.logging.ClientLogger; import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -30,7 +31,7 @@ public class ChargeSummary extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargeSummary.class); /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -39,10 +40,11 @@ public class ChargeSummary extends ProxyResource { * Resource tags. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeType.java deleted file mode 100644 index 2cc2e9a0a618..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeType.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.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for ChargeType. */ -public final class ChargeType extends ExpandableStringEnum { - /** Static value Actual for ChargeType. */ - public static final ChargeType ACTUAL = fromString("Actual"); - - /** Static value Forecast for ChargeType. */ - public static final ChargeType FORECAST = fromString("Forecast"); - - /** - * Creates or finds a ChargeType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ChargeType. - */ - @JsonCreator - public static ChargeType fromString(String name) { - return fromString(name, ChargeType.class); - } - - /** @return known ChargeType values. */ - public static Collection values() { - return values(ChargeType.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java index b6ccd59fe9f5..0610ce0df9c5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java @@ -27,17 +27,11 @@ public final class CreditBalanceSummary { private Amount currentBalance; /* - * Current balance. + * Estimated balance in billing currency. */ @JsonProperty(value = "estimatedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate estimatedBalanceInBillingCurrency; - /* - * Current balance. - */ - @JsonProperty(value = "currentBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate currentBalanceInBillingCurrency; - /** * Get the estimatedBalance property: Estimated balance. * @@ -57,7 +51,7 @@ public Amount currentBalance() { } /** - * Get the estimatedBalanceInBillingCurrency property: Current balance. + * Get the estimatedBalanceInBillingCurrency property: Estimated balance in billing currency. * * @return the estimatedBalanceInBillingCurrency value. */ @@ -65,15 +59,6 @@ public AmountWithExchangeRate estimatedBalanceInBillingCurrency() { return this.estimatedBalanceInBillingCurrency; } - /** - * Get the currentBalanceInBillingCurrency property: Current balance. - * - * @return the currentBalanceInBillingCurrency value. - */ - public AmountWithExchangeRate currentBalanceInBillingCurrency() { - return this.currentBalanceInBillingCurrency; - } - /** * Validates the instance. * @@ -89,8 +74,5 @@ public void validate() { if (estimatedBalanceInBillingCurrency() != null) { estimatedBalanceInBillingCurrency().validate(); } - if (currentBalanceInBillingCurrency() != null) { - currentBalanceInBillingCurrency().validate(); - } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java index e29dc637c1ff..8db755d5d0f4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java @@ -31,18 +31,18 @@ public interface CreditSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. + * Gets the etag property: The etag for the resource. * - * @return the creditCurrency value. + * @return the etag value. */ - String creditCurrency(); + String etag(); /** - * Gets the billingCurrency property: Billing Currency. + * Gets the tags property: Resource tags. * - * @return the billingCurrency value. + * @return the tags value. */ - String billingCurrency(); + Map tags(); /** * Gets the balanceSummary property: Summary of balances associated with this credit summary. @@ -73,25 +73,32 @@ public interface CreditSummary { Amount pendingEligibleCharges(); /** - * Gets the reseller property: Reseller details. + * Gets the creditCurrency property: The credit currency. * - * @return the reseller value. + * @return the creditCurrency value. */ - Reseller reseller(); + String creditCurrency(); /** - * Gets the etag property: Resource etag. + * Gets the billingCurrency property: The billing currency. * - * @return the etag value. + * @return the billingCurrency value. */ - String etag(); + String billingCurrency(); /** - * Gets the tags property: Resource tags. + * Gets the reseller property: Credit's reseller. * - * @return the tags value. + * @return the reseller value. */ - Map tags(); + Reseller reseller(); + + /** + * Gets the etagPropertiesEtag property: The eTag for the resource. + * + * @return the etagPropertiesEtag value. + */ + String etagPropertiesEtag(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner object. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java index f88f521d3f0b..c81237f13f37 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java @@ -12,31 +12,25 @@ public interface Credits { /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 credit summary resource. */ - CreditSummary get(String scope); + CreditSummary get(String billingAccountId, String billingProfileId); /** * The credit summary by billingAccountId and billingProfileId. * - * @param scope The scope associated with credits operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 credit summary resource. */ - Response getWithResponse(String scope, Context context); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java deleted file mode 100644 index a6e0879dd012..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java +++ /dev/null @@ -1,91 +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.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for CultureCode. */ -public final class CultureCode extends ExpandableStringEnum { - /** Static value en-us for CultureCode. */ - public static final CultureCode EN_US = fromString("en-us"); - - /** Static value ja-jp for CultureCode. */ - public static final CultureCode JA_JP = fromString("ja-jp"); - - /** Static value zh-cn for CultureCode. */ - public static final CultureCode ZH_CN = fromString("zh-cn"); - - /** Static value de-de for CultureCode. */ - public static final CultureCode DE_DE = fromString("de-de"); - - /** Static value es-es for CultureCode. */ - public static final CultureCode ES_ES = fromString("es-es"); - - /** Static value fr-fr for CultureCode. */ - public static final CultureCode FR_FR = fromString("fr-fr"); - - /** Static value it-it for CultureCode. */ - public static final CultureCode IT_IT = fromString("it-it"); - - /** Static value ko-kr for CultureCode. */ - public static final CultureCode KO_KR = fromString("ko-kr"); - - /** Static value pt-br for CultureCode. */ - public static final CultureCode PT_BR = fromString("pt-br"); - - /** Static value ru-ru for CultureCode. */ - public static final CultureCode RU_RU = fromString("ru-ru"); - - /** Static value zh-tw for CultureCode. */ - public static final CultureCode ZH_TW = fromString("zh-tw"); - - /** Static value cs-cz for CultureCode. */ - public static final CultureCode CS_CZ = fromString("cs-cz"); - - /** Static value pl-pl for CultureCode. */ - public static final CultureCode PL_PL = fromString("pl-pl"); - - /** Static value tr-tr for CultureCode. */ - public static final CultureCode TR_TR = fromString("tr-tr"); - - /** Static value da-dk for CultureCode. */ - public static final CultureCode DA_DK = fromString("da-dk"); - - /** Static value en-gb for CultureCode. */ - public static final CultureCode EN_GB = fromString("en-gb"); - - /** Static value hu-hu for CultureCode. */ - public static final CultureCode HU_HU = fromString("hu-hu"); - - /** Static value nb-no for CultureCode. */ - public static final CultureCode NB_NO = fromString("nb-no"); - - /** Static value nl-nl for CultureCode. */ - public static final CultureCode NL_NL = fromString("nl-nl"); - - /** Static value pt-pt for CultureCode. */ - public static final CultureCode PT_PT = fromString("pt-pt"); - - /** Static value sv-se for CultureCode. */ - public static final CultureCode SV_SE = fromString("sv-se"); - - /** - * Creates or finds a CultureCode from its string representation. - * - * @param name a name to look for. - * @return the corresponding CultureCode. - */ - @JsonCreator - public static CultureCode fromString(String name) { - return fromString(name, CultureCode.class); - } - - /** @return known CultureCode values. */ - public static Collection values() { - return values(CultureCode.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java index 17b27dd0407b..2e3671941ee4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java @@ -32,137 +32,186 @@ public interface EventSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. + * Gets the etag property: The etag for the resource. * - * @return the creditCurrency value. + * @return the etag value. */ - String creditCurrency(); + String etag(); /** - * Gets the billingCurrency property: Billing Currency. + * Gets the tags property: Resource tags. * - * @return the billingCurrency value. + * @return the tags value. */ - String billingCurrency(); + Map tags(); /** - * Gets the transactionDate property: Transaction date. + * Gets the transactionDate property: The date of the event. * * @return the transactionDate value. */ OffsetDateTime transactionDate(); /** - * Gets the description property: Transaction description. + * Gets the description property: The description of the event. * * @return the description value. */ String description(); /** - * Gets the newCredit property: New Credit. + * Gets the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. * * @return the newCredit value. */ Amount newCredit(); /** - * Gets the newCreditInBillingCurrency property: Current balance. + * Gets the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. * - * @return the newCreditInBillingCurrency value. + * @return the adjustments value. */ - AmountWithExchangeRate newCreditInBillingCurrency(); + Amount adjustments(); /** - * Gets the adjustments property: Adjustments amount. + * Gets the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * - * @return the adjustments value. + * @return the creditExpired value. */ - Amount adjustments(); + Amount creditExpired(); /** - * Gets the adjustmentsInBillingCurrency property: Current balance. + * Gets the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * - * @return the adjustmentsInBillingCurrency value. + * @return the charges value. */ - AmountWithExchangeRate adjustmentsInBillingCurrency(); + Amount charges(); /** - * Gets the creditExpired property: Credit expired. + * Gets the closedBalance property: The balance after the event. * - * @return the creditExpired value. + * @return the closedBalance value. */ - Amount creditExpired(); + Amount closedBalance(); /** - * Gets the creditExpiredInBillingCurrency property: Current balance. + * Gets the eventType property: Identifies the type of the event. * - * @return the creditExpiredInBillingCurrency value. + * @return the eventType value. */ - AmountWithExchangeRate creditExpiredInBillingCurrency(); + EventType eventType(); /** - * Gets the charges property: Charges amount. + * Gets the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. + * This will be empty for unbilled events. * - * @return the charges value. + * @return the invoiceNumber value. */ - Amount charges(); + String invoiceNumber(); /** - * Gets the chargesInBillingCurrency property: Current balance. + * Gets the billingProfileId property: The ID that uniquely identifies the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the chargesInBillingCurrency value. + * @return the billingProfileId value. */ - AmountWithExchangeRate chargesInBillingCurrency(); + String billingProfileId(); /** - * Gets the closedBalance property: Closed balance. + * Gets the billingProfileDisplayName property: The display name of the billing profile for which the event + * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. * - * @return the closedBalance value. + * @return the billingProfileDisplayName value. */ - Amount closedBalance(); + String billingProfileDisplayName(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. + * Gets the lotId property: The ID that uniquely identifies the lot for which the event happened. * - * @return the closedBalanceInBillingCurrency value. + * @return the lotId value. */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); + String lotId(); /** - * Gets the eventType property: The type of event. + * Gets the lotSource property: Identifies the source of the lot for which the event happened. * - * @return the eventType value. + * @return the lotSource value. */ - EventType eventType(); + String lotSource(); /** - * Gets the invoiceNumber property: Invoice number. + * Gets the canceledCredit property: Amount of canceled credit. * - * @return the invoiceNumber value. + * @return the canceledCredit value. */ - String invoiceNumber(); + Amount canceledCredit(); /** - * Gets the reseller property: Reseller details. + * Gets the creditCurrency property: The credit currency of the event. + * + * @return the creditCurrency value. + */ + String creditCurrency(); + + /** + * Gets the billingCurrency property: The billing currency of the event. + * + * @return the billingCurrency value. + */ + String billingCurrency(); + + /** + * Gets the reseller property: The reseller of the event. * * @return the reseller value. */ Reseller reseller(); /** - * Gets the etag property: Resource etag. + * Gets the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or + * SettleCharges event in billing currency. * - * @return the etag value. + * @return the creditExpiredInBillingCurrency value. */ - String etag(); + AmountWithExchangeRate creditExpiredInBillingCurrency(); /** - * Gets the tags property: Resource tags. + * Gets the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or + * SettleCharges event in billing currency. * - * @return the tags value. + * @return the newCreditInBillingCurrency value. */ - Map tags(); + AmountWithExchangeRate newCreditInBillingCurrency(); + + /** + * Gets the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. + * + * @return the adjustmentsInBillingCurrency value. + */ + AmountWithExchangeRate adjustmentsInBillingCurrency(); + + /** + * Gets the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and + * PendingEligibleCharges in billing currency. + * + * @return the chargesInBillingCurrency value. + */ + AmountWithExchangeRate chargesInBillingCurrency(); + + /** + * Gets the closedBalanceInBillingCurrency property: The balance in billing currency after the event. + * + * @return the closedBalanceInBillingCurrency value. + */ + AmountWithExchangeRate closedBalanceInBillingCurrency(); + + /** + * Gets the etagPropertiesEtag property: The eTag for the resource. + * + * @return the etagPropertiesEtag value. + */ + String etagPropertiesEtag(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner object. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java index 4cb4871b3b5a..8dba4861b35d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java @@ -10,37 +10,63 @@ /** Resource collection API of EventsOperations. */ public interface EventsOperations { /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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 event summary. */ - PagedIterable list(String startDate, String endDate, String scope); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate); /** - * Lists the events by billingAccountId and billingProfileId for given start and end date. + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. * + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. * @param endDate End date. - * @param scope The scope associated with events operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. * @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 event summary. */ - PagedIterable list(String startDate, String endDate, String scope, Context context); + PagedIterable listByBillingProfile( + String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @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 event summary. + */ + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or + * a billing profile for a given start and end date. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the events by lotId, lotSource etc. 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 is 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 result of listing event summary. + */ + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java deleted file mode 100644 index 239f07802ff9..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecast.java +++ /dev/null @@ -1,100 +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.consumption.models; - -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; -import java.math.BigDecimal; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Forecast. */ -public interface Forecast { - /** - * 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 usageDate property: The usage date of the forecast. - * - * @return the usageDate value. - */ - String usageDate(); - - /** - * Gets the grain property: The granularity of forecast. Please note that Yearly is not currently supported in this - * API. The API will provide responses in the Monthly grain if Yearly is selected. To get yearly grain data, please - * use our newer Forecast API. - * - * @return the grain value. - */ - Grain grain(); - - /** - * Gets the charge property: The amount of charge. - * - * @return the charge value. - */ - BigDecimal charge(); - - /** - * Gets the currency property: The ISO currency in which the meter is charged, for example, USD. - * - * @return the currency value. - */ - String currency(); - - /** - * Gets the chargeType property: The type of the charge. Could be actual or forecast. - * - * @return the chargeType value. - */ - ChargeType chargeType(); - - /** - * Gets the confidenceLevels property: The details about the forecast confidence levels. This is populated only when - * chargeType is Forecast. - * - * @return the confidenceLevels value. - */ - List confidenceLevels(); - - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ForecastInner object. - * - * @return the inner object. - */ - ForecastInner innerModel(); -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastPropertiesConfidenceLevelsItem.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastPropertiesConfidenceLevelsItem.java deleted file mode 100644 index 36c4a9a85b94..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastPropertiesConfidenceLevelsItem.java +++ /dev/null @@ -1,81 +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.consumption.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; - -/** The ForecastPropertiesConfidenceLevelsItem model. */ -@Fluent -public final class ForecastPropertiesConfidenceLevelsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ForecastPropertiesConfidenceLevelsItem.class); - - /* - * The percentage level of the confidence - */ - @JsonProperty(value = "percentage", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal percentage; - - /* - * The boundary of the percentage, values could be 'Upper' or 'Lower' - */ - @JsonProperty(value = "bound") - private Bound bound; - - /* - * The amount of forecast within the percentage level - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal value; - - /** - * Get the percentage property: The percentage level of the confidence. - * - * @return the percentage value. - */ - public BigDecimal percentage() { - return this.percentage; - } - - /** - * Get the bound property: The boundary of the percentage, values could be 'Upper' or 'Lower'. - * - * @return the bound value. - */ - public Bound bound() { - return this.bound; - } - - /** - * Set the bound property: The boundary of the percentage, values could be 'Upper' or 'Lower'. - * - * @param bound the bound value to set. - * @return the ForecastPropertiesConfidenceLevelsItem object itself. - */ - public ForecastPropertiesConfidenceLevelsItem withBound(Bound bound) { - this.bound = bound; - return this; - } - - /** - * Get the value property: The amount of forecast within the percentage level. - * - * @return the value value. - */ - public BigDecimal value() { - return this.value; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecasts.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecasts.java deleted file mode 100644 index decc99412cb0..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Forecasts.java +++ /dev/null @@ -1,38 +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.consumption.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Forecasts. */ -public interface Forecasts { - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @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 forecasts. - */ - PagedIterable list(); - - /** - * Lists the forecast charges for scope defined. Please note that this API is no longer actively under development. - * We recommend using our new Forecast API moving forward: - * https://docs.microsoft.com/en-us/rest/api/cost-management/forecast/usage. - * - * @param filter May be used to filter forecasts by properties/usageDate (Utc time), properties/chargeType or - * properties/grain. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support - * 'ne', 'or', or 'not'. - * @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 forecasts. - */ - PagedIterable list(String filter, Context context); -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastsListResult.java deleted file mode 100644 index af17355f5b8a..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastsListResult.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.consumption.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.fluent.models.ForecastInner; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Result of listing forecasts. It contains a list of available forecasts. */ -@Immutable -public final class ForecastsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ForecastsListResult.class); - - /* - * The list of forecasts. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /** - * Get the value property: The list of forecasts. - * - * @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/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Grain.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Grain.java deleted file mode 100644 index 83f37ee8db4e..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Grain.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.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Grain. */ -public final class Grain extends ExpandableStringEnum { - /** Static value Daily for Grain. */ - public static final Grain DAILY = fromString("Daily"); - - /** Static value Monthly for Grain. */ - public static final Grain MONTHLY = fromString("Monthly"); - - /** Static value Yearly for Grain. */ - public static final Grain YEARLY = fromString("Yearly"); - - /** - * Creates or finds a Grain from its string representation. - * - * @param name a name to look for. - * @return the corresponding Grain. - */ - @JsonCreator - public static Grain fromString(String name) { - return fromString(name, Grain.class); - } - - /** @return known Grain values. */ - public static Collection values() { - return values(Grain.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java index 54135595e987..c8f5c574c44e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.LegacyChargeSummaryProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -16,52 +16,24 @@ /** Legacy charge summary. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("legacy") -@JsonFlatten -@Immutable -public class LegacyChargeSummary extends ChargeSummary { +@Fluent +public final class LegacyChargeSummary extends ChargeSummary { @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummary.class); /* - * The id of the billing period resource that the charge belongs to. + * Properties for legacy charge summary */ - @JsonProperty(value = "properties.billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) - private String billingPeriodId; + @JsonProperty(value = "properties", required = true) + private LegacyChargeSummaryProperties innerProperties = new LegacyChargeSummaryProperties(); - /* - * Usage start date. - */ - @JsonProperty(value = "properties.usageStart", access = JsonProperty.Access.WRITE_ONLY) - private String usageStart; - - /* - * Usage end date. - */ - @JsonProperty(value = "properties.usageEnd", access = JsonProperty.Access.WRITE_ONLY) - private String usageEnd; - - /* - * Azure Charges. - */ - @JsonProperty(value = "properties.azureCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal azureCharges; - - /* - * Charges Billed separately. - */ - @JsonProperty(value = "properties.chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal chargesBilledSeparately; - - /* - * Marketplace Charges. - */ - @JsonProperty(value = "properties.marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal marketplaceCharges; - - /* - * Currency Code + /** + * Get the innerProperties property: Properties for legacy charge summary. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.currency", access = JsonProperty.Access.WRITE_ONLY) - private String currency; + private LegacyChargeSummaryProperties innerProperties() { + return this.innerProperties; + } /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. @@ -69,7 +41,7 @@ public class LegacyChargeSummary extends ChargeSummary { * @return the billingPeriodId value. */ public String billingPeriodId() { - return this.billingPeriodId; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodId(); } /** @@ -78,7 +50,7 @@ public String billingPeriodId() { * @return the usageStart value. */ public String usageStart() { - return this.usageStart; + return this.innerProperties() == null ? null : this.innerProperties().usageStart(); } /** @@ -87,7 +59,7 @@ public String usageStart() { * @return the usageEnd value. */ public String usageEnd() { - return this.usageEnd; + return this.innerProperties() == null ? null : this.innerProperties().usageEnd(); } /** @@ -96,7 +68,7 @@ public String usageEnd() { * @return the azureCharges value. */ public BigDecimal azureCharges() { - return this.azureCharges; + return this.innerProperties() == null ? null : this.innerProperties().azureCharges(); } /** @@ -105,7 +77,7 @@ public BigDecimal azureCharges() { * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { - return this.chargesBilledSeparately; + return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); } /** @@ -114,7 +86,7 @@ public BigDecimal chargesBilledSeparately() { * @return the marketplaceCharges value. */ public BigDecimal marketplaceCharges() { - return this.marketplaceCharges; + return this.innerProperties() == null ? null : this.innerProperties().marketplaceCharges(); } /** @@ -123,7 +95,7 @@ public BigDecimal marketplaceCharges() { * @return the currency value. */ public String currency() { - return this.currency; + return this.innerProperties() == null ? null : this.innerProperties().currency(); } /** @@ -134,5 +106,13 @@ public String currency() { @Override public void validate() { super.validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LegacyChargeSummary")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java index 485c58eb7e99..3f33692684b6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.LegacyReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,100 +20,24 @@ /** Legacy reservation recommendation. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("legacy") -@JsonFlatten -@Immutable -public class LegacyReservationRecommendation extends ReservationRecommendationInner { +@Fluent +public final class LegacyReservationRecommendation extends ReservationRecommendationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendation.class); /* - * The number of days of usage to look back for recommendation. + * Properties for legacy reservation recommendation */ - @JsonProperty(value = "properties.lookBackPeriod", access = JsonProperty.Access.WRITE_ONLY) - private String lookBackPeriod; + @JsonProperty(value = "properties", required = true) + private LegacyReservationRecommendationProperties innerProperties = new LegacyReservationRecommendationProperties(); - /* - * The instance Flexibility Ratio. - */ - @JsonProperty(value = "properties.instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) - private Float instanceFlexibilityRatio; - - /* - * The instance Flexibility Group. - */ - @JsonProperty(value = "properties.instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) - private String instanceFlexibilityGroup; - - /* - * The normalized Size. - */ - @JsonProperty(value = "properties.normalizedSize", access = JsonProperty.Access.WRITE_ONLY) - private String normalizedSize; - - /* - * The recommended Quantity Normalized. - */ - @JsonProperty(value = "properties.recommendedQuantityNormalized", access = JsonProperty.Access.WRITE_ONLY) - private Float recommendedQuantityNormalized; - - /* - * The meter id (GUID) - */ - @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private UUID meterId; - - /* - * The azure resource type. - */ - @JsonProperty(value = "properties.resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * RI recommendations in one or three year terms. - */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * The total amount of cost without reserved instances. - */ - @JsonProperty(value = "properties.costWithNoReservedInstances", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal costWithNoReservedInstances; - - /* - * Recommended quality for reserved instances. - */ - @JsonProperty(value = "properties.recommendedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal recommendedQuantity; - - /* - * The total amount of cost with reserved instances. - */ - @JsonProperty(value = "properties.totalCostWithReservedInstances", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal totalCostWithReservedInstances; - - /* - * Total estimated savings with reserved instances. - */ - @JsonProperty(value = "properties.netSavings", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal netSavings; - - /* - * The usage date for looking back. - */ - @JsonProperty(value = "properties.firstUsageDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime firstUsageDate; - - /* - * Shared or single recommendation. - */ - @JsonProperty(value = "properties.scope", access = JsonProperty.Access.WRITE_ONLY) - private String scope; - - /* - * List of sku properties + /** + * Get the innerProperties property: Properties for legacy reservation recommendation. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.skuProperties", access = JsonProperty.Access.WRITE_ONLY) - private List skuProperties; + private LegacyReservationRecommendationProperties innerProperties() { + return this.innerProperties; + } /** * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. @@ -121,7 +45,7 @@ public class LegacyReservationRecommendation extends ReservationRecommendationIn * @return the lookBackPeriod value. */ public String lookBackPeriod() { - return this.lookBackPeriod; + return this.innerProperties() == null ? null : this.innerProperties().lookBackPeriod(); } /** @@ -130,7 +54,7 @@ public String lookBackPeriod() { * @return the instanceFlexibilityRatio value. */ public Float instanceFlexibilityRatio() { - return this.instanceFlexibilityRatio; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityRatio(); } /** @@ -139,7 +63,7 @@ public Float instanceFlexibilityRatio() { * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { - return this.instanceFlexibilityGroup; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityGroup(); } /** @@ -148,7 +72,7 @@ public String instanceFlexibilityGroup() { * @return the normalizedSize value. */ public String normalizedSize() { - return this.normalizedSize; + return this.innerProperties() == null ? null : this.innerProperties().normalizedSize(); } /** @@ -157,7 +81,7 @@ public String normalizedSize() { * @return the recommendedQuantityNormalized value. */ public Float recommendedQuantityNormalized() { - return this.recommendedQuantityNormalized; + return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantityNormalized(); } /** @@ -166,7 +90,7 @@ public Float recommendedQuantityNormalized() { * @return the meterId value. */ public UUID meterId() { - return this.meterId; + return this.innerProperties() == null ? null : this.innerProperties().meterId(); } /** @@ -175,7 +99,7 @@ public UUID meterId() { * @return the resourceType value. */ public String resourceType() { - return this.resourceType; + return this.innerProperties() == null ? null : this.innerProperties().resourceType(); } /** @@ -184,7 +108,7 @@ public String resourceType() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -193,7 +117,7 @@ public String term() { * @return the costWithNoReservedInstances value. */ public BigDecimal costWithNoReservedInstances() { - return this.costWithNoReservedInstances; + return this.innerProperties() == null ? null : this.innerProperties().costWithNoReservedInstances(); } /** @@ -202,7 +126,7 @@ public BigDecimal costWithNoReservedInstances() { * @return the recommendedQuantity value. */ public BigDecimal recommendedQuantity() { - return this.recommendedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); } /** @@ -211,7 +135,7 @@ public BigDecimal recommendedQuantity() { * @return the totalCostWithReservedInstances value. */ public BigDecimal totalCostWithReservedInstances() { - return this.totalCostWithReservedInstances; + return this.innerProperties() == null ? null : this.innerProperties().totalCostWithReservedInstances(); } /** @@ -220,7 +144,7 @@ public BigDecimal totalCostWithReservedInstances() { * @return the netSavings value. */ public BigDecimal netSavings() { - return this.netSavings; + return this.innerProperties() == null ? null : this.innerProperties().netSavings(); } /** @@ -229,7 +153,7 @@ public BigDecimal netSavings() { * @return the firstUsageDate value. */ public OffsetDateTime firstUsageDate() { - return this.firstUsageDate; + return this.innerProperties() == null ? null : this.innerProperties().firstUsageDate(); } /** @@ -238,7 +162,7 @@ public OffsetDateTime firstUsageDate() { * @return the scope value. */ public String scope() { - return this.scope; + return this.innerProperties() == null ? null : this.innerProperties().scope(); } /** @@ -247,7 +171,7 @@ public String scope() { * @return the skuProperties value. */ public List skuProperties() { - return this.skuProperties; + return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); } /** @@ -258,8 +182,13 @@ public List skuProperties() { @Override public void validate() { super.validate(); - if (skuProperties() != null) { - skuProperties().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LegacyReservationRecommendation")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java index ebddba41eaa8..3149ee726979 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.LegacyUsageDetailProperties; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -19,282 +19,24 @@ /** Legacy usage detail. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("legacy") -@JsonFlatten -@Immutable -public class LegacyUsageDetail extends UsageDetailInner { +@Fluent +public final class LegacyUsageDetail extends UsageDetailInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetail.class); /* - * Billing Account identifier. + * Properties for legacy usage details */ - @JsonProperty(value = "properties.billingAccountId", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountId; + @JsonProperty(value = "properties", required = true) + private LegacyUsageDetailProperties innerProperties = new LegacyUsageDetailProperties(); - /* - * Billing Account Name. - */ - @JsonProperty(value = "properties.billingAccountName", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountName; - - /* - * The billing period start date. - */ - @JsonProperty(value = "properties.billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime billingPeriodStartDate; - - /* - * The billing period end date. - */ - @JsonProperty(value = "properties.billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime billingPeriodEndDate; - - /* - * Billing Profile identifier. - */ - @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * Billing Profile Name. - */ - @JsonProperty(value = "properties.billingProfileName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileName; - - /* - * Account Owner Id. - */ - @JsonProperty(value = "properties.accountOwnerId", access = JsonProperty.Access.WRITE_ONLY) - private String accountOwnerId; - - /* - * Account Name. - */ - @JsonProperty(value = "properties.accountName", access = JsonProperty.Access.WRITE_ONLY) - private String accountName; - - /* - * Subscription guid. - */ - @JsonProperty(value = "properties.subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; - - /* - * Subscription name. - */ - @JsonProperty(value = "properties.subscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionName; - - /* - * Date for the usage record. - */ - @JsonProperty(value = "properties.date", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime date; - - /* - * Product name for the consumed service or purchase. Not available for - * Marketplace. - */ - @JsonProperty(value = "properties.product", access = JsonProperty.Access.WRITE_ONLY) - private String product; - - /* - * Part Number of the service used. Can be used to join with the price - * sheet. Not available for marketplace. - */ - @JsonProperty(value = "properties.partNumber", access = JsonProperty.Access.WRITE_ONLY) - private String partNumber; - - /* - * The meter id (GUID). Not available for marketplace. For reserved - * instance this represents the primary meter for which the reservation was - * purchased. For the actual VM Size for which the reservation is purchased - * see productOrderName. - */ - @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private UUID meterId; - - /* - * The details about the meter. By default this is not populated, unless - * it's specified in $expand. - */ - @JsonProperty(value = "properties.meterDetails", access = JsonProperty.Access.WRITE_ONLY) - private MeterDetailsResponse meterDetails; - - /* - * The usage quantity. - */ - @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal quantity; - - /* - * Effective Price that's charged for the usage. - */ - @JsonProperty(value = "properties.effectivePrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal effectivePrice; - - /* - * The amount of cost before tax. - */ - @JsonProperty(value = "properties.cost", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal cost; - - /* - * Unit Price is the price applicable to you. (your EA or other contract - * price). - */ - @JsonProperty(value = "properties.unitPrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal unitPrice; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Resource Location. - */ - @JsonProperty(value = "properties.resourceLocation", access = JsonProperty.Access.WRITE_ONLY) - private String resourceLocation; - - /* - * Consumed service name. Name of the azure resource provider that emits - * the usage or was purchased. This value is not provided for marketplace - * usage. - */ - @JsonProperty(value = "properties.consumedService", access = JsonProperty.Access.WRITE_ONLY) - private String consumedService; - - /* - * Azure resource manager resource identifier. - */ - @JsonProperty(value = "properties.resourceId", access = JsonProperty.Access.WRITE_ONLY) - private String resourceId; - - /* - * Resource Name. - */ - @JsonProperty(value = "properties.resourceName", access = JsonProperty.Access.WRITE_ONLY) - private String resourceName; - - /* - * Service Info 1. - */ - @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) - private String serviceInfo1; - - /* - * Service Info 2. - */ - @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) - private String serviceInfo2; - - /* - * Additional details of this usage item. By default this is not populated, - * unless it's specified in $expand. Use this field to get usage line item - * specific details such as the actual VM Size (ServiceType) or the ratio - * in which the reservation discount is applied. - */ - @JsonProperty(value = "properties.additionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private String additionalInfo; - - /* - * Invoice Section Name. - */ - @JsonProperty(value = "properties.invoiceSection", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSection; - - /* - * The cost center of this department if it is a department and a cost - * center is provided. - */ - @JsonProperty(value = "properties.costCenter", access = JsonProperty.Access.WRITE_ONLY) - private String costCenter; - - /* - * Resource Group Name. - */ - @JsonProperty(value = "properties.resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * ARM resource id of the reservation. Only applies to records relevant to - * reservations. - */ - @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationId; - - /* - * User provided display name of the reservation. Last known name for a - * particular day is populated in the daily data. Only applies to records - * relevant to reservations. - */ - @JsonProperty(value = "properties.reservationName", access = JsonProperty.Access.WRITE_ONLY) - private String reservationName; - - /* - * Product Order Id. For reservations this is the Reservation Order ID. - */ - @JsonProperty(value = "properties.productOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String productOrderId; - - /* - * Product Order Name. For reservations this is the SKU that was purchased. - */ - @JsonProperty(value = "properties.productOrderName", access = JsonProperty.Access.WRITE_ONLY) - private String productOrderName; - - /* - * Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. - */ - @JsonProperty(value = "properties.offerId", access = JsonProperty.Access.WRITE_ONLY) - private String offerId; - - /* - * Is Azure Credit Eligible. - */ - @JsonProperty(value = "properties.isAzureCreditEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isAzureCreditEligible; - - /* - * Term (in months). 1 month for monthly recurring purchase. 12 months for - * a 1 year reservation. 36 months for a 3 year reservation. - */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * Publisher Name. - */ - @JsonProperty(value = "properties.publisherName", access = JsonProperty.Access.WRITE_ONLY) - private String publisherName; - - /* - * Publisher Type. - */ - @JsonProperty(value = "properties.publisherType", access = JsonProperty.Access.WRITE_ONLY) - private String publisherType; - - /* - * Plan Name. - */ - @JsonProperty(value = "properties.planName", access = JsonProperty.Access.WRITE_ONLY) - private String planName; - - /* - * Indicates a charge represents credits, usage, a Marketplace purchase, a - * reservation fee, or a refund. - */ - @JsonProperty(value = "properties.chargeType", access = JsonProperty.Access.WRITE_ONLY) - private String chargeType; - - /* - * Indicates how frequently this charge will occur. OneTime for purchases - * which only happen once, Monthly for fees which recur every month, and - * UsageBased for charges based on how much a service is used. + /** + * Get the innerProperties property: Properties for legacy usage details. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.frequency", access = JsonProperty.Access.WRITE_ONLY) - private String frequency; + private LegacyUsageDetailProperties innerProperties() { + return this.innerProperties; + } /** * Get the billingAccountId property: Billing Account identifier. @@ -302,7 +44,7 @@ public class LegacyUsageDetail extends UsageDetailInner { * @return the billingAccountId value. */ public String billingAccountId() { - return this.billingAccountId; + return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); } /** @@ -311,7 +53,7 @@ public String billingAccountId() { * @return the billingAccountName value. */ public String billingAccountName() { - return this.billingAccountName; + return this.innerProperties() == null ? null : this.innerProperties().billingAccountName(); } /** @@ -320,7 +62,7 @@ public String billingAccountName() { * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { - return this.billingPeriodStartDate; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodStartDate(); } /** @@ -329,7 +71,7 @@ public OffsetDateTime billingPeriodStartDate() { * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { - return this.billingPeriodEndDate; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodEndDate(); } /** @@ -338,7 +80,7 @@ public OffsetDateTime billingPeriodEndDate() { * @return the billingProfileId value. */ public String billingProfileId() { - return this.billingProfileId; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -347,7 +89,7 @@ public String billingProfileId() { * @return the billingProfileName value. */ public String billingProfileName() { - return this.billingProfileName; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileName(); } /** @@ -356,7 +98,7 @@ public String billingProfileName() { * @return the accountOwnerId value. */ public String accountOwnerId() { - return this.accountOwnerId; + return this.innerProperties() == null ? null : this.innerProperties().accountOwnerId(); } /** @@ -365,7 +107,7 @@ public String accountOwnerId() { * @return the accountName value. */ public String accountName() { - return this.accountName; + return this.innerProperties() == null ? null : this.innerProperties().accountName(); } /** @@ -374,7 +116,7 @@ public String accountName() { * @return the subscriptionId value. */ public String subscriptionId() { - return this.subscriptionId; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); } /** @@ -383,7 +125,7 @@ public String subscriptionId() { * @return the subscriptionName value. */ public String subscriptionName() { - return this.subscriptionName; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); } /** @@ -392,7 +134,7 @@ public String subscriptionName() { * @return the date value. */ public OffsetDateTime date() { - return this.date; + return this.innerProperties() == null ? null : this.innerProperties().date(); } /** @@ -401,7 +143,7 @@ public OffsetDateTime date() { * @return the product value. */ public String product() { - return this.product; + return this.innerProperties() == null ? null : this.innerProperties().product(); } /** @@ -411,7 +153,7 @@ public String product() { * @return the partNumber value. */ public String partNumber() { - return this.partNumber; + return this.innerProperties() == null ? null : this.innerProperties().partNumber(); } /** @@ -422,7 +164,7 @@ public String partNumber() { * @return the meterId value. */ public UUID meterId() { - return this.meterId; + return this.innerProperties() == null ? null : this.innerProperties().meterId(); } /** @@ -432,7 +174,7 @@ public UUID meterId() { * @return the meterDetails value. */ public MeterDetailsResponse meterDetails() { - return this.meterDetails; + return this.innerProperties() == null ? null : this.innerProperties().meterDetails(); } /** @@ -441,7 +183,7 @@ public MeterDetailsResponse meterDetails() { * @return the quantity value. */ public BigDecimal quantity() { - return this.quantity; + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** @@ -450,7 +192,7 @@ public BigDecimal quantity() { * @return the effectivePrice value. */ public BigDecimal effectivePrice() { - return this.effectivePrice; + return this.innerProperties() == null ? null : this.innerProperties().effectivePrice(); } /** @@ -459,7 +201,7 @@ public BigDecimal effectivePrice() { * @return the cost value. */ public BigDecimal cost() { - return this.cost; + return this.innerProperties() == null ? null : this.innerProperties().cost(); } /** @@ -468,7 +210,7 @@ public BigDecimal cost() { * @return the unitPrice value. */ public BigDecimal unitPrice() { - return this.unitPrice; + return this.innerProperties() == null ? null : this.innerProperties().unitPrice(); } /** @@ -477,7 +219,7 @@ public BigDecimal unitPrice() { * @return the billingCurrency value. */ public String billingCurrency() { - return this.billingCurrency; + return this.innerProperties() == null ? null : this.innerProperties().billingCurrency(); } /** @@ -486,7 +228,7 @@ public String billingCurrency() { * @return the resourceLocation value. */ public String resourceLocation() { - return this.resourceLocation; + return this.innerProperties() == null ? null : this.innerProperties().resourceLocation(); } /** @@ -496,16 +238,16 @@ public String resourceLocation() { * @return the consumedService value. */ public String consumedService() { - return this.consumedService; + return this.innerProperties() == null ? null : this.innerProperties().consumedService(); } /** - * Get the resourceId property: Azure resource manager resource identifier. + * Get the resourceId property: Unique identifier of the Azure Resource Manager usage detail resource. * * @return the resourceId value. */ public String resourceId() { - return this.resourceId; + return this.innerProperties() == null ? null : this.innerProperties().resourceId(); } /** @@ -514,25 +256,25 @@ public String resourceId() { * @return the resourceName value. */ public String resourceName() { - return this.resourceName; + return this.innerProperties() == null ? null : this.innerProperties().resourceName(); } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ public String serviceInfo1() { - return this.serviceInfo1; + return this.innerProperties() == null ? null : this.innerProperties().serviceInfo1(); } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ public String serviceInfo2() { - return this.serviceInfo2; + return this.innerProperties() == null ? null : this.innerProperties().serviceInfo2(); } /** @@ -543,7 +285,7 @@ public String serviceInfo2() { * @return the additionalInfo value. */ public String additionalInfo() { - return this.additionalInfo; + return this.innerProperties() == null ? null : this.innerProperties().additionalInfo(); } /** @@ -552,7 +294,7 @@ public String additionalInfo() { * @return the invoiceSection value. */ public String invoiceSection() { - return this.invoiceSection; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSection(); } /** @@ -562,7 +304,7 @@ public String invoiceSection() { * @return the costCenter value. */ public String costCenter() { - return this.costCenter; + return this.innerProperties() == null ? null : this.innerProperties().costCenter(); } /** @@ -571,7 +313,7 @@ public String costCenter() { * @return the resourceGroup value. */ public String resourceGroup() { - return this.resourceGroup; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); } /** @@ -581,7 +323,7 @@ public String resourceGroup() { * @return the reservationId value. */ public String reservationId() { - return this.reservationId; + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); } /** @@ -591,7 +333,7 @@ public String reservationId() { * @return the reservationName value. */ public String reservationName() { - return this.reservationName; + return this.innerProperties() == null ? null : this.innerProperties().reservationName(); } /** @@ -600,7 +342,7 @@ public String reservationName() { * @return the productOrderId value. */ public String productOrderId() { - return this.productOrderId; + return this.innerProperties() == null ? null : this.innerProperties().productOrderId(); } /** @@ -609,7 +351,7 @@ public String productOrderId() { * @return the productOrderName value. */ public String productOrderName() { - return this.productOrderName; + return this.innerProperties() == null ? null : this.innerProperties().productOrderName(); } /** @@ -618,7 +360,7 @@ public String productOrderName() { * @return the offerId value. */ public String offerId() { - return this.offerId; + return this.innerProperties() == null ? null : this.innerProperties().offerId(); } /** @@ -627,7 +369,7 @@ public String offerId() { * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { - return this.isAzureCreditEligible; + return this.innerProperties() == null ? null : this.innerProperties().isAzureCreditEligible(); } /** @@ -637,7 +379,7 @@ public Boolean isAzureCreditEligible() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -646,7 +388,7 @@ public String term() { * @return the publisherName value. */ public String publisherName() { - return this.publisherName; + return this.innerProperties() == null ? null : this.innerProperties().publisherName(); } /** @@ -655,7 +397,7 @@ public String publisherName() { * @return the publisherType value. */ public String publisherType() { - return this.publisherType; + return this.innerProperties() == null ? null : this.innerProperties().publisherType(); } /** @@ -664,7 +406,7 @@ public String publisherType() { * @return the planName value. */ public String planName() { - return this.planName; + return this.innerProperties() == null ? null : this.innerProperties().planName(); } /** @@ -674,7 +416,7 @@ public String planName() { * @return the chargeType value. */ public String chargeType() { - return this.chargeType; + return this.innerProperties() == null ? null : this.innerProperties().chargeType(); } /** @@ -685,7 +427,25 @@ public String chargeType() { * @return the frequency value. */ public String frequency() { - return this.frequency; + return this.innerProperties() == null ? null : this.innerProperties().frequency(); + } + + /** + * Get the payGPrice property: Retail price for the resource. + * + * @return the payGPrice value. + */ + public BigDecimal payGPrice() { + return this.innerProperties() == null ? null : this.innerProperties().payGPrice(); + } + + /** + * Get the pricingModel property: Identifier that indicates how the meter is priced. + * + * @return the pricingModel value. + */ + public PricingModelType pricingModel() { + return this.innerProperties() == null ? null : this.innerProperties().pricingModel(); } /** @@ -696,8 +456,13 @@ public String frequency() { @Override public void validate() { super.validate(); - if (meterDetails() != null) { - meterDetails().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model LegacyUsageDetail")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java index 5ad1d4f4dc75..9db625833099 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java @@ -16,6 +16,9 @@ public final class LotSource extends ExpandableStringEnum { /** Static value PromotionalCredit for LotSource. */ public static final LotSource PROMOTIONAL_CREDIT = fromString("PromotionalCredit"); + /** Static value ConsumptionCommitment for LotSource. */ + public static final LotSource CONSUMPTION_COMMITMENT = fromString("ConsumptionCommitment"); + /** * Creates or finds a LotSource from its string representation. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java index 86797bdbd258..34ac82e2f603 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java @@ -32,95 +32,117 @@ public interface LotSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. + * Gets the etag property: The etag for the resource. * - * @return the creditCurrency value. + * @return the etag value. */ - String creditCurrency(); + String etag(); /** - * Gets the billingCurrency property: Billing Currency. + * Gets the tags property: Resource tags. * - * @return the billingCurrency value. + * @return the tags value. */ - String billingCurrency(); + Map tags(); /** - * Gets the originalAmount property: Original amount. + * Gets the originalAmount property: The original amount of a lot. * * @return the originalAmount value. */ Amount originalAmount(); /** - * Gets the originalAmountInBillingCurrency property: Current balance. - * - * @return the originalAmountInBillingCurrency value. - */ - AmountWithExchangeRate originalAmountInBillingCurrency(); - - /** - * Gets the closedBalance property: Closed balance. + * Gets the closedBalance property: The balance as of the last invoice. * * @return the closedBalance value. */ Amount closedBalance(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. - * - * @return the closedBalanceInBillingCurrency value. - */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); - - /** - * Gets the source property: Lot source. + * Gets the source property: The source of the lot. * * @return the source value. */ LotSource source(); /** - * Gets the startDate property: Start date. + * Gets the startDate property: The date when the lot became effective. * * @return the startDate value. */ OffsetDateTime startDate(); /** - * Gets the expirationDate property: Expiration date. + * Gets the expirationDate property: The expiration date of a lot. * * @return the expirationDate value. */ OffsetDateTime expirationDate(); /** - * Gets the poNumber property: PO number. + * Gets the poNumber property: The po number of the invoice on which the lot was added. This property is not + * available for ConsumptionCommitment lots. * * @return the poNumber value. */ String poNumber(); /** - * Gets the reseller property: Reseller details. + * Gets the purchasedDate property: The date when the lot was added. * - * @return the reseller value. + * @return the purchasedDate value. */ - Reseller reseller(); + OffsetDateTime purchasedDate(); /** - * Gets the etag property: Resource etag. + * Gets the status property: The status of the lot. * - * @return the etag value. + * @return the status value. */ - String etag(); + Status status(); /** - * Gets the tags property: Resource tags. + * Gets the creditCurrency property: The currency of the lot. * - * @return the tags value. + * @return the creditCurrency value. */ - Map tags(); + String creditCurrency(); + + /** + * Gets the billingCurrency property: The billing currency of the lot. + * + * @return the billingCurrency value. + */ + String billingCurrency(); + + /** + * Gets the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. + * + * @return the originalAmountInBillingCurrency value. + */ + AmountWithExchangeRate originalAmountInBillingCurrency(); + + /** + * Gets the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. + * + * @return the closedBalanceInBillingCurrency value. + */ + AmountWithExchangeRate closedBalanceInBillingCurrency(); + + /** + * Gets the reseller property: The reseller of the lot. + * + * @return the reseller value. + */ + Reseller reseller(); + + /** + * Gets the etagPropertiesEtag property: The eTag for the resource. + * + * @return the etagPropertiesEtag value. + */ + String etagPropertiesEtag(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner object. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java index bd0c75f7c8c5..bab1d91c0f17 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java @@ -10,33 +10,57 @@ /** Resource collection API of LotsOperations. */ public interface LotsOperations { /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 lot summary. */ - PagedIterable list(String scope); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId); /** - * Lists the lots by billingAccountId and billingProfileId. + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. * - * @param scope The scope associated with Lots operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfile/{billingProfileId}' for - * Billing Profile scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * @param billingAccountId BillingAccount ID. + * @param billingProfileId Azure Billing Profile ID. * @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 lot summary. */ - PagedIterable list(String scope, Context context); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, Context context); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @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 lot summary. + */ + PagedIterable listByBillingAccount(String billingAccountId); + + /** + * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. + * Microsoft Azure consumption commitments are only supported for the billing account scope. + * + * @param billingAccountId BillingAccount ID. + * @param filter May be used to filter the lots by Status, Source etc. 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 is 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 result of listing lot summary. + */ + PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java index 0ee54f25b7a2..36c2dcef4774 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java @@ -33,6 +33,20 @@ public interface ManagementGroupAggregatedCostResult { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the billingPeriodId property: The id of the billing period resource that the aggregated cost belongs to. * @@ -105,20 +119,6 @@ public interface ManagementGroupAggregatedCostResult { */ List excludedSubscriptions(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner * object. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java index 7357eea22708..1574bc764b08 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java @@ -33,6 +33,20 @@ public interface Marketplace { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the billingPeriodId property: The id of the billing period resource that the usage belongs to. * @@ -216,20 +230,6 @@ public interface Marketplace { */ Boolean isRecurringCharge(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java index cd0b9a98a62c..8450965787a1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.ModernChargeSummaryProperties; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -15,76 +15,24 @@ /** Modern charge summary. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("modern") -@JsonFlatten -@Immutable -public class ModernChargeSummary extends ChargeSummary { +@Fluent +public final class ModernChargeSummary extends ChargeSummary { @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummary.class); /* - * The id of the billing period resource that the charge belongs to. + * Properties for modern charge summary */ - @JsonProperty(value = "properties.billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) - private String billingPeriodId; + @JsonProperty(value = "properties", required = true) + private ModernChargeSummaryProperties innerProperties = new ModernChargeSummaryProperties(); - /* - * Usage start date. - */ - @JsonProperty(value = "properties.usageStart", access = JsonProperty.Access.WRITE_ONLY) - private String usageStart; - - /* - * Usage end date. - */ - @JsonProperty(value = "properties.usageEnd", access = JsonProperty.Access.WRITE_ONLY) - private String usageEnd; - - /* - * Azure Charges. - */ - @JsonProperty(value = "properties.azureCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount azureCharges; - - /* - * Charges Billed separately. - */ - @JsonProperty(value = "properties.chargesBilledSeparately", access = JsonProperty.Access.WRITE_ONLY) - private Amount chargesBilledSeparately; - - /* - * Marketplace Charges. - */ - @JsonProperty(value = "properties.marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) - private Amount marketplaceCharges; - - /* - * Billing Account Id - */ - @JsonProperty(value = "properties.billingAccountId", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountId; - - /* - * Billing Profile Id - */ - @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * Invoice Section Id - */ - @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * Customer Id - */ - @JsonProperty(value = "properties.customerId", access = JsonProperty.Access.WRITE_ONLY) - private String customerId; - - /* - * Is charge Invoiced + /** + * Get the innerProperties property: Properties for modern charge summary. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.isInvoiced", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isInvoiced; + private ModernChargeSummaryProperties innerProperties() { + return this.innerProperties; + } /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. @@ -92,7 +40,7 @@ public class ModernChargeSummary extends ChargeSummary { * @return the billingPeriodId value. */ public String billingPeriodId() { - return this.billingPeriodId; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodId(); } /** @@ -101,7 +49,7 @@ public String billingPeriodId() { * @return the usageStart value. */ public String usageStart() { - return this.usageStart; + return this.innerProperties() == null ? null : this.innerProperties().usageStart(); } /** @@ -110,7 +58,7 @@ public String usageStart() { * @return the usageEnd value. */ public String usageEnd() { - return this.usageEnd; + return this.innerProperties() == null ? null : this.innerProperties().usageEnd(); } /** @@ -119,7 +67,7 @@ public String usageEnd() { * @return the azureCharges value. */ public Amount azureCharges() { - return this.azureCharges; + return this.innerProperties() == null ? null : this.innerProperties().azureCharges(); } /** @@ -128,7 +76,7 @@ public Amount azureCharges() { * @return the chargesBilledSeparately value. */ public Amount chargesBilledSeparately() { - return this.chargesBilledSeparately; + return this.innerProperties() == null ? null : this.innerProperties().chargesBilledSeparately(); } /** @@ -137,7 +85,7 @@ public Amount chargesBilledSeparately() { * @return the marketplaceCharges value. */ public Amount marketplaceCharges() { - return this.marketplaceCharges; + return this.innerProperties() == null ? null : this.innerProperties().marketplaceCharges(); } /** @@ -146,7 +94,7 @@ public Amount marketplaceCharges() { * @return the billingAccountId value. */ public String billingAccountId() { - return this.billingAccountId; + return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); } /** @@ -155,7 +103,7 @@ public String billingAccountId() { * @return the billingProfileId value. */ public String billingProfileId() { - return this.billingProfileId; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -164,7 +112,7 @@ public String billingProfileId() { * @return the invoiceSectionId value. */ public String invoiceSectionId() { - return this.invoiceSectionId; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** @@ -173,7 +121,7 @@ public String invoiceSectionId() { * @return the customerId value. */ public String customerId() { - return this.customerId; + return this.innerProperties() == null ? null : this.innerProperties().customerId(); } /** @@ -182,7 +130,7 @@ public String customerId() { * @return the isInvoiced value. */ public Boolean isInvoiced() { - return this.isInvoiced; + return this.innerProperties() == null ? null : this.innerProperties().isInvoiced(); } /** @@ -193,14 +141,13 @@ public Boolean isInvoiced() { @Override public void validate() { super.validate(); - if (azureCharges() != null) { - azureCharges().validate(); - } - if (chargesBilledSeparately() != null) { - chargesBilledSeparately().validate(); - } - if (marketplaceCharges() != null) { - marketplaceCharges().validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ModernChargeSummary")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java index b7493021a212..85f3bd155f59 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.ModernReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,141 +20,32 @@ /** Modern reservation recommendation. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("modern") -@JsonFlatten -@Immutable -public class ModernReservationRecommendation extends ReservationRecommendationInner { +@Fluent +public final class ModernReservationRecommendation extends ReservationRecommendationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendation.class); /* - * Resource eTag. + * Properties for modern reservation recommendation */ - @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - - /* - * Resource Location. - */ - @JsonProperty(value = "properties.location", access = JsonProperty.Access.WRITE_ONLY) - private String locationPropertiesLocation; - - /* - * The number of days of usage to look back for recommendation. - */ - @JsonProperty(value = "properties.lookBackPeriod", access = JsonProperty.Access.WRITE_ONLY) - private Integer lookBackPeriod; - - /* - * The instance Flexibility Ratio. - */ - @JsonProperty(value = "properties.instanceFlexibilityRatio", access = JsonProperty.Access.WRITE_ONLY) - private Float instanceFlexibilityRatio; - - /* - * The instance Flexibility Group. - */ - @JsonProperty(value = "properties.instanceFlexibilityGroup", access = JsonProperty.Access.WRITE_ONLY) - private String instanceFlexibilityGroup; - - /* - * The normalized Size. - */ - @JsonProperty(value = "properties.normalizedSize", access = JsonProperty.Access.WRITE_ONLY) - private String normalizedSize; - - /* - * The recommended Quantity Normalized. - */ - @JsonProperty(value = "properties.recommendedQuantityNormalized", access = JsonProperty.Access.WRITE_ONLY) - private Float recommendedQuantityNormalized; - - /* - * The meter id (GUID) - */ - @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private UUID meterId; - - /* - * RI recommendations in one or three year terms. - */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * The total amount of cost without reserved instances. - */ - @JsonProperty(value = "properties.costWithNoReservedInstances", access = JsonProperty.Access.WRITE_ONLY) - private Amount costWithNoReservedInstances; - - /* - * Recommended quality for reserved instances. - */ - @JsonProperty(value = "properties.recommendedQuantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal recommendedQuantity; - - /* - * The total amount of cost with reserved instances. - */ - @JsonProperty(value = "properties.totalCostWithReservedInstances", access = JsonProperty.Access.WRITE_ONLY) - private Amount totalCostWithReservedInstances; - - /* - * Total estimated savings with reserved instances. - */ - @JsonProperty(value = "properties.netSavings", access = JsonProperty.Access.WRITE_ONLY) - private Amount netSavings; - - /* - * The usage date for looking back. - */ - @JsonProperty(value = "properties.firstUsageDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime firstUsageDate; - - /* - * Shared or single recommendation. - */ - @JsonProperty(value = "properties.scope", access = JsonProperty.Access.WRITE_ONLY) - private String scope; - - /* - * List of sku properties - */ - @JsonProperty(value = "properties.skuProperties", access = JsonProperty.Access.WRITE_ONLY) - private List skuProperties; - - /* - * This is the ARM Sku name. - */ - @JsonProperty(value = "properties.skuName", access = JsonProperty.Access.WRITE_ONLY) - private String skuName; - - /* - * The Azure resource type. - */ - @JsonProperty(value = "properties.resourceType", access = JsonProperty.Access.WRITE_ONLY) - private String resourceType; - - /* - * The Azure subscription ID. - */ - @JsonProperty(value = "properties.subscriptionId", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionId; + @JsonProperty(value = "properties", required = true) + private ModernReservationRecommendationProperties innerProperties = new ModernReservationRecommendationProperties(); /** - * Get the etag property: Resource eTag. + * Get the innerProperties property: Properties for modern reservation recommendation. * - * @return the etag value. + * @return the innerProperties value. */ - public String etag() { - return this.etag; + private ModernReservationRecommendationProperties innerProperties() { + return this.innerProperties; } /** - * Get the locationPropertiesLocation property: Resource Location. + * Get the location property: Resource Location. * - * @return the locationPropertiesLocation value. + * @return the location value. */ public String locationPropertiesLocation() { - return this.locationPropertiesLocation; + return this.innerProperties() == null ? null : this.innerProperties().location(); } /** @@ -163,7 +54,7 @@ public String locationPropertiesLocation() { * @return the lookBackPeriod value. */ public Integer lookBackPeriod() { - return this.lookBackPeriod; + return this.innerProperties() == null ? null : this.innerProperties().lookBackPeriod(); } /** @@ -172,7 +63,7 @@ public Integer lookBackPeriod() { * @return the instanceFlexibilityRatio value. */ public Float instanceFlexibilityRatio() { - return this.instanceFlexibilityRatio; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityRatio(); } /** @@ -181,7 +72,7 @@ public Float instanceFlexibilityRatio() { * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { - return this.instanceFlexibilityGroup; + return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityGroup(); } /** @@ -190,7 +81,7 @@ public String instanceFlexibilityGroup() { * @return the normalizedSize value. */ public String normalizedSize() { - return this.normalizedSize; + return this.innerProperties() == null ? null : this.innerProperties().normalizedSize(); } /** @@ -199,7 +90,7 @@ public String normalizedSize() { * @return the recommendedQuantityNormalized value. */ public Float recommendedQuantityNormalized() { - return this.recommendedQuantityNormalized; + return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantityNormalized(); } /** @@ -208,7 +99,7 @@ public Float recommendedQuantityNormalized() { * @return the meterId value. */ public UUID meterId() { - return this.meterId; + return this.innerProperties() == null ? null : this.innerProperties().meterId(); } /** @@ -217,7 +108,7 @@ public UUID meterId() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -226,7 +117,7 @@ public String term() { * @return the costWithNoReservedInstances value. */ public Amount costWithNoReservedInstances() { - return this.costWithNoReservedInstances; + return this.innerProperties() == null ? null : this.innerProperties().costWithNoReservedInstances(); } /** @@ -235,7 +126,7 @@ public Amount costWithNoReservedInstances() { * @return the recommendedQuantity value. */ public BigDecimal recommendedQuantity() { - return this.recommendedQuantity; + return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); } /** @@ -244,7 +135,7 @@ public BigDecimal recommendedQuantity() { * @return the totalCostWithReservedInstances value. */ public Amount totalCostWithReservedInstances() { - return this.totalCostWithReservedInstances; + return this.innerProperties() == null ? null : this.innerProperties().totalCostWithReservedInstances(); } /** @@ -253,7 +144,7 @@ public Amount totalCostWithReservedInstances() { * @return the netSavings value. */ public Amount netSavings() { - return this.netSavings; + return this.innerProperties() == null ? null : this.innerProperties().netSavings(); } /** @@ -262,7 +153,7 @@ public Amount netSavings() { * @return the firstUsageDate value. */ public OffsetDateTime firstUsageDate() { - return this.firstUsageDate; + return this.innerProperties() == null ? null : this.innerProperties().firstUsageDate(); } /** @@ -271,7 +162,7 @@ public OffsetDateTime firstUsageDate() { * @return the scope value. */ public String scope() { - return this.scope; + return this.innerProperties() == null ? null : this.innerProperties().scope(); } /** @@ -280,7 +171,7 @@ public String scope() { * @return the skuProperties value. */ public List skuProperties() { - return this.skuProperties; + return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); } /** @@ -289,25 +180,7 @@ public List skuProperties() { * @return the skuName value. */ public String skuName() { - return this.skuName; - } - - /** - * Get the resourceType property: The Azure resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.resourceType; - } - - /** - * Get the subscriptionId property: The Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; + return this.innerProperties() == null ? null : this.innerProperties().skuName(); } /** @@ -318,17 +191,13 @@ public String subscriptionId() { @Override public void validate() { super.validate(); - if (costWithNoReservedInstances() != null) { - costWithNoReservedInstances().validate(); - } - if (totalCostWithReservedInstances() != null) { - totalCostWithReservedInstances().validate(); - } - if (netSavings() != null) { - netSavings().validate(); - } - if (skuProperties() != null) { - skuProperties().forEach(e -> e.validate()); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ModernReservationRecommendation")); + } else { + innerProperties().validate(); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java index b08b6916d865..8d35112b0136 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java @@ -4,9 +4,9 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Immutable; -import com.azure.core.annotation.JsonFlatten; +import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.consumption.fluent.models.ModernUsageDetailProperties; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; @@ -14,466 +14,55 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.OffsetDateTime; +import java.util.UUID; /** Modern usage detail. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("modern") -@JsonFlatten -@Immutable -public class ModernUsageDetail extends UsageDetailInner { +@Fluent +public final class ModernUsageDetail extends UsageDetailInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetail.class); /* - * Billing Account identifier. + * Properties for modern usage details */ - @JsonProperty(value = "properties.billingAccountId", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountId; + @JsonProperty(value = "properties", required = true) + private ModernUsageDetailProperties innerProperties = new ModernUsageDetailProperties(); - /* - * Name of the Billing Account. - */ - @JsonProperty(value = "properties.billingAccountName", access = JsonProperty.Access.WRITE_ONLY) - private String billingAccountName; - - /* - * Billing Period Start Date as in the invoice. - */ - @JsonProperty(value = "properties.billingPeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime billingPeriodStartDate; - - /* - * Billing Period End Date as in the invoice. - */ - @JsonProperty(value = "properties.billingPeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime billingPeriodEndDate; - - /* - * Identifier for the billing profile that groups costs across invoices in - * the a singular billing currency across across the customers who have - * onboarded the Microsoft customer agreement and the customers in CSP who - * have made entitlement purchases like SaaS, Marketplace, RI, etc. - */ - @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileId; - - /* - * Name of the billing profile that groups costs across invoices in the a - * singular billing currency across across the customers who have onboarded - * the Microsoft customer agreement and the customers in CSP who have made - * entitlement purchases like SaaS, Marketplace, RI, etc. - */ - @JsonProperty(value = "properties.billingProfileName", access = JsonProperty.Access.WRITE_ONLY) - private String billingProfileName; - - /* - * Unique Microsoft generated identifier for the Azure Subscription. - */ - @JsonProperty(value = "properties.subscriptionGuid", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionGuid; - - /* - * Name of the Azure Subscription. - */ - @JsonProperty(value = "properties.subscriptionName", access = JsonProperty.Access.WRITE_ONLY) - private String subscriptionName; - - /* - * Date for the usage record. - */ - @JsonProperty(value = "properties.date", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime date; - - /* - * Name of the product that has accrued charges by consumption or purchase - * as listed in the invoice. Not available for Marketplace. - */ - @JsonProperty(value = "properties.product", access = JsonProperty.Access.WRITE_ONLY) - private String product; - - /* - * The meter id (GUID). Not available for marketplace. For reserved - * instance this represents the primary meter for which the reservation was - * purchased. For the actual VM Size for which the reservation is purchased - * see productOrderName. - */ - @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private String meterId; - - /* - * Identifies the name of the meter against which consumption is measured. - */ - @JsonProperty(value = "properties.meterName", access = JsonProperty.Access.WRITE_ONLY) - private String meterName; - - /* - * Identifies the location of the datacenter for certain services that are - * priced based on datacenter location. - */ - @JsonProperty(value = "properties.meterRegion", access = JsonProperty.Access.WRITE_ONLY) - private String meterRegion; - - /* - * Identifies the top-level service for the usage. - */ - @JsonProperty(value = "properties.meterCategory", access = JsonProperty.Access.WRITE_ONLY) - private String meterCategory; - - /* - * Defines the type or sub-category of Azure service that can affect the - * rate. - */ - @JsonProperty(value = "properties.meterSubCategory", access = JsonProperty.Access.WRITE_ONLY) - private String meterSubCategory; - - /* - * List the service family for the product purchased or charged (Example: - * Storage ; Compute). - */ - @JsonProperty(value = "properties.serviceFamily", access = JsonProperty.Access.WRITE_ONLY) - private String serviceFamily; - - /* - * Measure the quantity purchased or consumed.The amount of the meter used - * during the billing period. - */ - @JsonProperty(value = "properties.quantity", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal quantity; - - /* - * Identifies the Unit that the service is charged in. For example, GB, - * hours, 10,000 s. - */ - @JsonProperty(value = "properties.unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) - private String unitOfMeasure; - - /* - * Instance Name. - */ - @JsonProperty(value = "properties.instanceName", access = JsonProperty.Access.WRITE_ONLY) - private String instanceName; - - /* - * Estimated extendedCost or blended cost before tax in USD. - */ - @JsonProperty(value = "properties.costInUSD", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal costInUsd; - - /* - * Unit Price is the price applicable to you. (your EA or other contract - * price). - */ - @JsonProperty(value = "properties.unitPrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal unitPrice; - - /* - * The currency defining the billed cost. - */ - @JsonProperty(value = "properties.billingCurrencyCode", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrencyCode; - - /* - * Name of the resource location. - */ - @JsonProperty(value = "properties.resourceLocation", access = JsonProperty.Access.WRITE_ONLY) - private String resourceLocation; - - /* - * Consumed service name. Name of the azure resource provider that emits - * the usage or was purchased. This value is not provided for marketplace - * usage. - */ - @JsonProperty(value = "properties.consumedService", access = JsonProperty.Access.WRITE_ONLY) - private String consumedService; - - /* - * Service Info 1. - */ - @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) - private String serviceInfo1; - - /* - * Service Info 2. - */ - @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) - private String serviceInfo2; - - /* - * Additional details of this usage item. Use this field to get usage line - * item specific details such as the actual VM Size (ServiceType) or the - * ratio in which the reservation discount is applied. - */ - @JsonProperty(value = "properties.additionalInfo", access = JsonProperty.Access.WRITE_ONLY) - private String additionalInfo; - - /* - * Identifier of the project that is being charged in the invoice. Not - * applicable for Microsoft Customer Agreements onboarded by partners. - */ - @JsonProperty(value = "properties.invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionId; - - /* - * Name of the project that is being charged in the invoice. Not applicable - * for Microsoft Customer Agreements onboarded by partners. - */ - @JsonProperty(value = "properties.invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceSectionName; - - /* - * The cost center of this department if it is a department and a cost - * center is provided. - */ - @JsonProperty(value = "properties.costCenter", access = JsonProperty.Access.WRITE_ONLY) - private String costCenter; - - /* - * Name of the Azure resource group used for cohesive lifecycle management - * of resources. - */ - @JsonProperty(value = "properties.resourceGroup", access = JsonProperty.Access.WRITE_ONLY) - private String resourceGroup; - - /* - * ARM resource id of the reservation. Only applies to records relevant to - * reservations. - */ - @JsonProperty(value = "properties.reservationId", access = JsonProperty.Access.WRITE_ONLY) - private String reservationId; - - /* - * User provided display name of the reservation. Last known name for a - * particular day is populated in the daily data. Only applies to records - * relevant to reservations. - */ - @JsonProperty(value = "properties.reservationName", access = JsonProperty.Access.WRITE_ONLY) - private String reservationName; - - /* - * The identifier for the asset or Azure plan name that the subscription - * belongs to. For example: Azure Plan. For reservations this is the - * Reservation Order ID. - */ - @JsonProperty(value = "properties.productOrderId", access = JsonProperty.Access.WRITE_ONLY) - private String productOrderId; - - /* - * Product Order Name. For reservations this is the SKU that was purchased. - */ - @JsonProperty(value = "properties.productOrderName", access = JsonProperty.Access.WRITE_ONLY) - private String productOrderName; - - /* - * Determines if the cost is eligible to be paid for using Azure credits. - */ - @JsonProperty(value = "properties.isAzureCreditEligible", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isAzureCreditEligible; - - /* - * Term (in months). Displays the term for the validity of the offer. For - * example. In case of reserved instances it displays 12 months for yearly - * term of reserved instance. For one time purchases or recurring - * purchases, the terms displays 1 month; This is not applicable for Azure - * consumption. - */ - @JsonProperty(value = "properties.term", access = JsonProperty.Access.WRITE_ONLY) - private String term; - - /* - * Name of the publisher of the service including Microsoft or Third Party - * publishers. - */ - @JsonProperty(value = "properties.publisherName", access = JsonProperty.Access.WRITE_ONLY) - private String publisherName; - - /* - * Type of publisher that identifies if the publisher is first party, third - * party reseller or third party agency. - */ - @JsonProperty(value = "properties.publisherType", access = JsonProperty.Access.WRITE_ONLY) - private String publisherType; - - /* - * Indicates a charge represents credits, usage, a Marketplace purchase, a - * reservation fee, or a refund. - */ - @JsonProperty(value = "properties.chargeType", access = JsonProperty.Access.WRITE_ONLY) - private String chargeType; - - /* - * Indicates how frequently this charge will occur. OneTime for purchases - * which only happen once, Monthly for fees which recur every month, and - * UsageBased for charges based on how much a service is used. - */ - @JsonProperty(value = "properties.frequency", access = JsonProperty.Access.WRITE_ONLY) - private String frequency; - - /* - * ExtendedCost or blended cost before tax in billed currency. - */ - @JsonProperty(value = "properties.costInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal costInBillingCurrency; - - /* - * ExtendedCost or blended cost before tax in pricing currency to correlate - * with prices. - */ - @JsonProperty(value = "properties.costInPricingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal costInPricingCurrency; - - /* - * Exchange rate used in conversion from pricing currency to billing - * currency. - */ - @JsonProperty(value = "properties.exchangeRate", access = JsonProperty.Access.WRITE_ONLY) - private String exchangeRate; - - /* - * Date on which exchange rate used in conversion from pricing currency to - * billing currency. - */ - @JsonProperty(value = "properties.exchangeRateDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime exchangeRateDate; - - /* - * Invoice ID as on the invoice where the specific transaction appears. - */ - @JsonProperty(value = "properties.invoiceId", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceId; - - /* - * Reference to an original invoice there is a refund (negative cost). This - * is populated only when there is a refund. - */ - @JsonProperty(value = "properties.previousInvoiceId", access = JsonProperty.Access.WRITE_ONLY) - private String previousInvoiceId; - - /* - * Pricing Billing Currency. - */ - @JsonProperty(value = "properties.pricingCurrencyCode", access = JsonProperty.Access.WRITE_ONLY) - private String pricingCurrencyCode; - - /* - * Identifier for the product that has accrued charges by consumption or - * purchase . This is the concatenated key of productId and SkuId in - * partner center. - */ - @JsonProperty(value = "properties.productIdentifier", access = JsonProperty.Access.WRITE_ONLY) - private String productIdentifier; - - /* - * Resource Location Normalized. - */ - @JsonProperty(value = "properties.resourceLocationNormalized", access = JsonProperty.Access.WRITE_ONLY) - private String resourceLocationNormalized; - - /* - * Start date for the rating period when the service usage was rated for - * charges. The prices for Azure services are determined for the rating - * period. - */ - @JsonProperty(value = "properties.servicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime servicePeriodStartDate; - - /* - * End date for the period when the service usage was rated for charges. - * The prices for Azure services are determined based on the rating period. - */ - @JsonProperty(value = "properties.servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime servicePeriodEndDate; - - /* - * Identifier of the customer's AAD tenant. - */ - @JsonProperty(value = "properties.customerTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String customerTenantId; - - /* - * Name of the customer's AAD tenant. - */ - @JsonProperty(value = "properties.customerName", access = JsonProperty.Access.WRITE_ONLY) - private String customerName; - - /* - * Identifier for the partner's AAD tenant. - */ - @JsonProperty(value = "properties.partnerTenantId", access = JsonProperty.Access.WRITE_ONLY) - private String partnerTenantId; - - /* - * Name of the partner' AAD tenant. - */ - @JsonProperty(value = "properties.partnerName", access = JsonProperty.Access.WRITE_ONLY) - private String partnerName; - - /* - * MPNId for the reseller associated with the subscription. - */ - @JsonProperty(value = "properties.resellerMpnId", access = JsonProperty.Access.WRITE_ONLY) - private String resellerMpnId; - - /* - * Reseller Name. - */ - @JsonProperty(value = "properties.resellerName", access = JsonProperty.Access.WRITE_ONLY) - private String resellerName; - - /* - * Publisher Id. - */ - @JsonProperty(value = "properties.publisherId", access = JsonProperty.Access.WRITE_ONLY) - private String publisherId; - - /* - * Market Price that's charged for the usage. - */ - @JsonProperty(value = "properties.marketPrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal marketPrice; - - /* - * Exchange Rate from pricing currency to billing currency. - */ - @JsonProperty(value = "properties.exchangeRatePricingToBilling", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal exchangeRatePricingToBilling; - - /* - * The amount of PayG cost before tax in billing currency. - */ - @JsonProperty(value = "properties.paygCostInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal paygCostInBillingCurrency; - - /* - * The amount of PayG cost before tax in US Dollar currency. - */ - @JsonProperty(value = "properties.paygCostInUSD", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal paygCostInUsd; - - /* - * Rate of discount applied if there is a partner earned credit (PEC) based - * on partner admin link access. + /** + * Get the innerProperties property: Properties for modern usage details. + * + * @return the innerProperties value. */ - @JsonProperty(value = "properties.partnerEarnedCreditRate", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal partnerEarnedCreditRate; + private ModernUsageDetailProperties innerProperties() { + return this.innerProperties; + } - /* - * Flag to indicate if partner earned credit has been applied or not. + /** + * Get the billingAccountId property: Billing Account identifier. + * + * @return the billingAccountId value. */ - @JsonProperty(value = "properties.partnerEarnedCreditApplied", access = JsonProperty.Access.WRITE_ONLY) - private String partnerEarnedCreditApplied; + public String billingAccountId() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); + } - /* - * Retail price for the resource. + /** + * Get the effectivePrice property: Effective Price that's charged for the usage. + * + * @return the effectivePrice value. */ - @JsonProperty(value = "properties.payGPrice", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal payGPrice; + public BigDecimal effectivePrice() { + return this.innerProperties() == null ? null : this.innerProperties().effectivePrice(); + } /** - * Get the billingAccountId property: Billing Account identifier. + * Get the pricingModel property: Identifier that indicates how the meter is priced. * - * @return the billingAccountId value. + * @return the pricingModel value. */ - public String billingAccountId() { - return this.billingAccountId; + public PricingModelType pricingModel() { + return this.innerProperties() == null ? null : this.innerProperties().pricingModel(); } /** @@ -482,7 +71,7 @@ public String billingAccountId() { * @return the billingAccountName value. */ public String billingAccountName() { - return this.billingAccountName; + return this.innerProperties() == null ? null : this.innerProperties().billingAccountName(); } /** @@ -491,7 +80,7 @@ public String billingAccountName() { * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { - return this.billingPeriodStartDate; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodStartDate(); } /** @@ -500,7 +89,7 @@ public OffsetDateTime billingPeriodStartDate() { * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { - return this.billingPeriodEndDate; + return this.innerProperties() == null ? null : this.innerProperties().billingPeriodEndDate(); } /** @@ -511,7 +100,7 @@ public OffsetDateTime billingPeriodEndDate() { * @return the billingProfileId value. */ public String billingProfileId() { - return this.billingProfileId; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileId(); } /** @@ -522,7 +111,7 @@ public String billingProfileId() { * @return the billingProfileName value. */ public String billingProfileName() { - return this.billingProfileName; + return this.innerProperties() == null ? null : this.innerProperties().billingProfileName(); } /** @@ -531,7 +120,7 @@ public String billingProfileName() { * @return the subscriptionGuid value. */ public String subscriptionGuid() { - return this.subscriptionGuid; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionGuid(); } /** @@ -540,7 +129,7 @@ public String subscriptionGuid() { * @return the subscriptionName value. */ public String subscriptionName() { - return this.subscriptionName; + return this.innerProperties() == null ? null : this.innerProperties().subscriptionName(); } /** @@ -549,7 +138,7 @@ public String subscriptionName() { * @return the date value. */ public OffsetDateTime date() { - return this.date; + return this.innerProperties() == null ? null : this.innerProperties().date(); } /** @@ -559,7 +148,7 @@ public OffsetDateTime date() { * @return the product value. */ public String product() { - return this.product; + return this.innerProperties() == null ? null : this.innerProperties().product(); } /** @@ -569,8 +158,8 @@ public String product() { * * @return the meterId value. */ - public String meterId() { - return this.meterId; + public UUID meterId() { + return this.innerProperties() == null ? null : this.innerProperties().meterId(); } /** @@ -579,7 +168,7 @@ public String meterId() { * @return the meterName value. */ public String meterName() { - return this.meterName; + return this.innerProperties() == null ? null : this.innerProperties().meterName(); } /** @@ -589,7 +178,7 @@ public String meterName() { * @return the meterRegion value. */ public String meterRegion() { - return this.meterRegion; + return this.innerProperties() == null ? null : this.innerProperties().meterRegion(); } /** @@ -598,7 +187,7 @@ public String meterRegion() { * @return the meterCategory value. */ public String meterCategory() { - return this.meterCategory; + return this.innerProperties() == null ? null : this.innerProperties().meterCategory(); } /** @@ -607,7 +196,7 @@ public String meterCategory() { * @return the meterSubCategory value. */ public String meterSubCategory() { - return this.meterSubCategory; + return this.innerProperties() == null ? null : this.innerProperties().meterSubCategory(); } /** @@ -617,7 +206,7 @@ public String meterSubCategory() { * @return the serviceFamily value. */ public String serviceFamily() { - return this.serviceFamily; + return this.innerProperties() == null ? null : this.innerProperties().serviceFamily(); } /** @@ -627,7 +216,7 @@ public String serviceFamily() { * @return the quantity value. */ public BigDecimal quantity() { - return this.quantity; + return this.innerProperties() == null ? null : this.innerProperties().quantity(); } /** @@ -637,7 +226,7 @@ public BigDecimal quantity() { * @return the unitOfMeasure value. */ public String unitOfMeasure() { - return this.unitOfMeasure; + return this.innerProperties() == null ? null : this.innerProperties().unitOfMeasure(); } /** @@ -646,7 +235,7 @@ public String unitOfMeasure() { * @return the instanceName value. */ public String instanceName() { - return this.instanceName; + return this.innerProperties() == null ? null : this.innerProperties().instanceName(); } /** @@ -655,7 +244,7 @@ public String instanceName() { * @return the costInUsd value. */ public BigDecimal costInUsd() { - return this.costInUsd; + return this.innerProperties() == null ? null : this.innerProperties().costInUsd(); } /** @@ -664,7 +253,7 @@ public BigDecimal costInUsd() { * @return the unitPrice value. */ public BigDecimal unitPrice() { - return this.unitPrice; + return this.innerProperties() == null ? null : this.innerProperties().unitPrice(); } /** @@ -673,7 +262,7 @@ public BigDecimal unitPrice() { * @return the billingCurrencyCode value. */ public String billingCurrencyCode() { - return this.billingCurrencyCode; + return this.innerProperties() == null ? null : this.innerProperties().billingCurrencyCode(); } /** @@ -682,7 +271,7 @@ public String billingCurrencyCode() { * @return the resourceLocation value. */ public String resourceLocation() { - return this.resourceLocation; + return this.innerProperties() == null ? null : this.innerProperties().resourceLocation(); } /** @@ -692,25 +281,25 @@ public String resourceLocation() { * @return the consumedService value. */ public String consumedService() { - return this.consumedService; + return this.innerProperties() == null ? null : this.innerProperties().consumedService(); } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ public String serviceInfo1() { - return this.serviceInfo1; + return this.innerProperties() == null ? null : this.innerProperties().serviceInfo1(); } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ public String serviceInfo2() { - return this.serviceInfo2; + return this.innerProperties() == null ? null : this.innerProperties().serviceInfo2(); } /** @@ -721,7 +310,7 @@ public String serviceInfo2() { * @return the additionalInfo value. */ public String additionalInfo() { - return this.additionalInfo; + return this.innerProperties() == null ? null : this.innerProperties().additionalInfo(); } /** @@ -731,7 +320,7 @@ public String additionalInfo() { * @return the invoiceSectionId value. */ public String invoiceSectionId() { - return this.invoiceSectionId; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionId(); } /** @@ -741,7 +330,7 @@ public String invoiceSectionId() { * @return the invoiceSectionName value. */ public String invoiceSectionName() { - return this.invoiceSectionName; + return this.innerProperties() == null ? null : this.innerProperties().invoiceSectionName(); } /** @@ -751,7 +340,7 @@ public String invoiceSectionName() { * @return the costCenter value. */ public String costCenter() { - return this.costCenter; + return this.innerProperties() == null ? null : this.innerProperties().costCenter(); } /** @@ -761,7 +350,7 @@ public String costCenter() { * @return the resourceGroup value. */ public String resourceGroup() { - return this.resourceGroup; + return this.innerProperties() == null ? null : this.innerProperties().resourceGroup(); } /** @@ -771,7 +360,7 @@ public String resourceGroup() { * @return the reservationId value. */ public String reservationId() { - return this.reservationId; + return this.innerProperties() == null ? null : this.innerProperties().reservationId(); } /** @@ -781,7 +370,7 @@ public String reservationId() { * @return the reservationName value. */ public String reservationName() { - return this.reservationName; + return this.innerProperties() == null ? null : this.innerProperties().reservationName(); } /** @@ -791,7 +380,7 @@ public String reservationName() { * @return the productOrderId value. */ public String productOrderId() { - return this.productOrderId; + return this.innerProperties() == null ? null : this.innerProperties().productOrderId(); } /** @@ -800,7 +389,7 @@ public String productOrderId() { * @return the productOrderName value. */ public String productOrderName() { - return this.productOrderName; + return this.innerProperties() == null ? null : this.innerProperties().productOrderName(); } /** @@ -809,7 +398,7 @@ public String productOrderName() { * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { - return this.isAzureCreditEligible; + return this.innerProperties() == null ? null : this.innerProperties().isAzureCreditEligible(); } /** @@ -820,7 +409,7 @@ public Boolean isAzureCreditEligible() { * @return the term value. */ public String term() { - return this.term; + return this.innerProperties() == null ? null : this.innerProperties().term(); } /** @@ -830,7 +419,7 @@ public String term() { * @return the publisherName value. */ public String publisherName() { - return this.publisherName; + return this.innerProperties() == null ? null : this.innerProperties().publisherName(); } /** @@ -840,7 +429,7 @@ public String publisherName() { * @return the publisherType value. */ public String publisherType() { - return this.publisherType; + return this.innerProperties() == null ? null : this.innerProperties().publisherType(); } /** @@ -850,7 +439,7 @@ public String publisherType() { * @return the chargeType value. */ public String chargeType() { - return this.chargeType; + return this.innerProperties() == null ? null : this.innerProperties().chargeType(); } /** @@ -861,7 +450,7 @@ public String chargeType() { * @return the frequency value. */ public String frequency() { - return this.frequency; + return this.innerProperties() == null ? null : this.innerProperties().frequency(); } /** @@ -870,7 +459,7 @@ public String frequency() { * @return the costInBillingCurrency value. */ public BigDecimal costInBillingCurrency() { - return this.costInBillingCurrency; + return this.innerProperties() == null ? null : this.innerProperties().costInBillingCurrency(); } /** @@ -880,7 +469,7 @@ public BigDecimal costInBillingCurrency() { * @return the costInPricingCurrency value. */ public BigDecimal costInPricingCurrency() { - return this.costInPricingCurrency; + return this.innerProperties() == null ? null : this.innerProperties().costInPricingCurrency(); } /** @@ -889,7 +478,7 @@ public BigDecimal costInPricingCurrency() { * @return the exchangeRate value. */ public String exchangeRate() { - return this.exchangeRate; + return this.innerProperties() == null ? null : this.innerProperties().exchangeRate(); } /** @@ -899,7 +488,7 @@ public String exchangeRate() { * @return the exchangeRateDate value. */ public OffsetDateTime exchangeRateDate() { - return this.exchangeRateDate; + return this.innerProperties() == null ? null : this.innerProperties().exchangeRateDate(); } /** @@ -908,7 +497,7 @@ public OffsetDateTime exchangeRateDate() { * @return the invoiceId value. */ public String invoiceId() { - return this.invoiceId; + return this.innerProperties() == null ? null : this.innerProperties().invoiceId(); } /** @@ -918,7 +507,7 @@ public String invoiceId() { * @return the previousInvoiceId value. */ public String previousInvoiceId() { - return this.previousInvoiceId; + return this.innerProperties() == null ? null : this.innerProperties().previousInvoiceId(); } /** @@ -927,7 +516,7 @@ public String previousInvoiceId() { * @return the pricingCurrencyCode value. */ public String pricingCurrencyCode() { - return this.pricingCurrencyCode; + return this.innerProperties() == null ? null : this.innerProperties().pricingCurrencyCode(); } /** @@ -937,7 +526,7 @@ public String pricingCurrencyCode() { * @return the productIdentifier value. */ public String productIdentifier() { - return this.productIdentifier; + return this.innerProperties() == null ? null : this.innerProperties().productIdentifier(); } /** @@ -946,7 +535,7 @@ public String productIdentifier() { * @return the resourceLocationNormalized value. */ public String resourceLocationNormalized() { - return this.resourceLocationNormalized; + return this.innerProperties() == null ? null : this.innerProperties().resourceLocationNormalized(); } /** @@ -956,7 +545,7 @@ public String resourceLocationNormalized() { * @return the servicePeriodStartDate value. */ public OffsetDateTime servicePeriodStartDate() { - return this.servicePeriodStartDate; + return this.innerProperties() == null ? null : this.innerProperties().servicePeriodStartDate(); } /** @@ -966,7 +555,7 @@ public OffsetDateTime servicePeriodStartDate() { * @return the servicePeriodEndDate value. */ public OffsetDateTime servicePeriodEndDate() { - return this.servicePeriodEndDate; + return this.innerProperties() == null ? null : this.innerProperties().servicePeriodEndDate(); } /** @@ -975,7 +564,7 @@ public OffsetDateTime servicePeriodEndDate() { * @return the customerTenantId value. */ public String customerTenantId() { - return this.customerTenantId; + return this.innerProperties() == null ? null : this.innerProperties().customerTenantId(); } /** @@ -984,7 +573,7 @@ public String customerTenantId() { * @return the customerName value. */ public String customerName() { - return this.customerName; + return this.innerProperties() == null ? null : this.innerProperties().customerName(); } /** @@ -993,7 +582,7 @@ public String customerName() { * @return the partnerTenantId value. */ public String partnerTenantId() { - return this.partnerTenantId; + return this.innerProperties() == null ? null : this.innerProperties().partnerTenantId(); } /** @@ -1002,7 +591,7 @@ public String partnerTenantId() { * @return the partnerName value. */ public String partnerName() { - return this.partnerName; + return this.innerProperties() == null ? null : this.innerProperties().partnerName(); } /** @@ -1011,7 +600,7 @@ public String partnerName() { * @return the resellerMpnId value. */ public String resellerMpnId() { - return this.resellerMpnId; + return this.innerProperties() == null ? null : this.innerProperties().resellerMpnId(); } /** @@ -1020,7 +609,7 @@ public String resellerMpnId() { * @return the resellerName value. */ public String resellerName() { - return this.resellerName; + return this.innerProperties() == null ? null : this.innerProperties().resellerName(); } /** @@ -1029,7 +618,7 @@ public String resellerName() { * @return the publisherId value. */ public String publisherId() { - return this.publisherId; + return this.innerProperties() == null ? null : this.innerProperties().publisherId(); } /** @@ -1038,7 +627,7 @@ public String publisherId() { * @return the marketPrice value. */ public BigDecimal marketPrice() { - return this.marketPrice; + return this.innerProperties() == null ? null : this.innerProperties().marketPrice(); } /** @@ -1047,7 +636,7 @@ public BigDecimal marketPrice() { * @return the exchangeRatePricingToBilling value. */ public BigDecimal exchangeRatePricingToBilling() { - return this.exchangeRatePricingToBilling; + return this.innerProperties() == null ? null : this.innerProperties().exchangeRatePricingToBilling(); } /** @@ -1056,7 +645,7 @@ public BigDecimal exchangeRatePricingToBilling() { * @return the paygCostInBillingCurrency value. */ public BigDecimal paygCostInBillingCurrency() { - return this.paygCostInBillingCurrency; + return this.innerProperties() == null ? null : this.innerProperties().paygCostInBillingCurrency(); } /** @@ -1065,7 +654,7 @@ public BigDecimal paygCostInBillingCurrency() { * @return the paygCostInUsd value. */ public BigDecimal paygCostInUsd() { - return this.paygCostInUsd; + return this.innerProperties() == null ? null : this.innerProperties().paygCostInUsd(); } /** @@ -1075,7 +664,7 @@ public BigDecimal paygCostInUsd() { * @return the partnerEarnedCreditRate value. */ public BigDecimal partnerEarnedCreditRate() { - return this.partnerEarnedCreditRate; + return this.innerProperties() == null ? null : this.innerProperties().partnerEarnedCreditRate(); } /** @@ -1084,7 +673,7 @@ public BigDecimal partnerEarnedCreditRate() { * @return the partnerEarnedCreditApplied value. */ public String partnerEarnedCreditApplied() { - return this.partnerEarnedCreditApplied; + return this.innerProperties() == null ? null : this.innerProperties().partnerEarnedCreditApplied(); } /** @@ -1093,7 +682,44 @@ public String partnerEarnedCreditApplied() { * @return the payGPrice value. */ public BigDecimal payGPrice() { - return this.payGPrice; + return this.innerProperties() == null ? null : this.innerProperties().payGPrice(); + } + + /** + * Get the benefitId property: Unique identifier for the applicable benefit. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.innerProperties() == null ? null : this.innerProperties().benefitId(); + } + + /** + * Get the benefitName property: Name of the applicable benefit. + * + * @return the benefitName value. + */ + public String benefitName() { + return this.innerProperties() == null ? null : this.innerProperties().benefitName(); + } + + /** + * Get the provider property: Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS + * e.t.c. + * + * @return the provider value. + */ + public String provider() { + return this.innerProperties() == null ? null : this.innerProperties().provider(); + } + + /** + * Get the costAllocationRuleName property: Name for Cost Allocation Rule. + * + * @return the costAllocationRuleName value. + */ + public String costAllocationRuleName() { + return this.innerProperties() == null ? null : this.innerProperties().costAllocationRuleName(); } /** @@ -1104,5 +730,13 @@ public BigDecimal payGPrice() { @Override public void validate() { super.validate(); + if (innerProperties() == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + "Missing required property innerProperties in model ModernUsageDetail")); + } else { + innerProperties().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java index ac6302aac9a7..e1ff302f134e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java @@ -66,12 +66,6 @@ public final class Notification { @JsonProperty(value = "thresholdType") private ThresholdType thresholdType; - /* - * Language in which the recipient will receive the notification - */ - @JsonProperty(value = "locale") - private CultureCode locale; - /** * Get the enabled property: The notification is enabled or not. * @@ -220,26 +214,6 @@ public Notification withThresholdType(ThresholdType thresholdType) { return this; } - /** - * Get the locale property: Language in which the recipient will receive the notification. - * - * @return the locale value. - */ - public CultureCode locale() { - return this.locale; - } - - /** - * Set the locale property: Language in which the recipient will receive the notification. - * - * @param locale the locale value to set. - * @return the Notification object itself. - */ - public Notification withLocale(CultureCode locale) { - this.locale = locale; - return this; - } - /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java index e0ba5fa402cb..1ee724071a48 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java @@ -31,6 +31,20 @@ public interface PriceSheetResult { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the pricesheets property: Price sheet. * @@ -52,20 +66,6 @@ public interface PriceSheetResult { */ MeterDetails download(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java index 90f922a28aa4..13bfc45db8b9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java @@ -10,18 +10,16 @@ /** Resource collection API of PriceSheets. */ public interface PriceSheets { /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ PriceSheetResult get(); /** - * Gets the price sheet for a scope by subscriptionId. Price sheet is available via this API only for May 1, 2014 or - * later. + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. @@ -33,7 +31,7 @@ public interface PriceSheets { * @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 price sheet for a scope by subscriptionId. + * @return the price sheet for a subscription. */ Response getWithResponse(String expand, String skiptoken, Integer top, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java new file mode 100644 index 000000000000..cb9d22a246d8 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for PricingModelType. */ +public final class PricingModelType extends ExpandableStringEnum { + /** Static value On Demand for PricingModelType. */ + public static final PricingModelType ON_DEMAND = fromString("On Demand"); + + /** Static value Reservation for PricingModelType. */ + public static final PricingModelType RESERVATION = fromString("Reservation"); + + /** Static value Spot for PricingModelType. */ + public static final PricingModelType SPOT = fromString("Spot"); + + /** + * Creates or finds a PricingModelType from its string representation. + * + * @param name a name to look for. + * @return the corresponding PricingModelType. + */ + @JsonCreator + public static PricingModelType fromString(String name) { + return fromString(name, PricingModelType.class); + } + + /** @return known PricingModelType values. */ + public static Collection values() { + return values(PricingModelType.class); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java index 1be58a1561cf..029cada6fe01 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java @@ -9,25 +9,25 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** Reseller details. */ +/** The reseller properties. */ @Immutable public final class Reseller { @JsonIgnore private final ClientLogger logger = new ClientLogger(Reseller.class); /* - * Reseller id. + * The reseller property ID. */ @JsonProperty(value = "resellerId", access = JsonProperty.Access.WRITE_ONLY) private String resellerId; /* - * Reseller Description. + * The reseller property description. */ @JsonProperty(value = "resellerDescription", access = JsonProperty.Access.WRITE_ONLY) private String resellerDescription; /** - * Get the resellerId property: Reseller id. + * Get the resellerId property: The reseller property ID. * * @return the resellerId value. */ @@ -36,7 +36,7 @@ public String resellerId() { } /** - * Get the resellerDescription property: Reseller Description. + * Get the resellerDescription property: The reseller property description. * * @return the resellerDescription value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java index 0af7e6888e00..3ef807da985f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java @@ -32,6 +32,20 @@ public interface ReservationDetail { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The @@ -116,20 +130,6 @@ public interface ReservationDetail { */ String kind(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java index 26dd1a302f20..6740c206fff4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java @@ -10,21 +10,28 @@ /** An immutable client-side representation of ReservationRecommendation. */ public interface ReservationRecommendation { /** - * Gets the location property: Resource location. + * Gets the id property: Fully qualified resource Id for the resource. * - * @return the location value. + * @return the id value. */ - String location(); + String id(); /** - * Gets the sku property: Resource sku. + * Gets the name property: The name of the resource. * - * @return the sku value. + * @return the name value. */ - String sku(); + String name(); /** - * Gets the etag property: Resource etag. + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the etag property: The etag for the resource. * * @return the etag value. */ @@ -37,6 +44,20 @@ public interface ReservationRecommendation { */ Map tags(); + /** + * Gets the location property: Resource location. + * + * @return the location value. + */ + String location(); + + /** + * Gets the sku property: Resource sku. + * + * @return the sku value. + */ + String sku(); + /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java index c7454899d831..4c93fb135ef7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java @@ -12,13 +12,12 @@ public interface ReservationRecommendationDetails { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -30,18 +29,17 @@ public interface ReservationRecommendationDetails { * @return reservation recommendation details. */ ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param billingScope The scope associated with reservation recommendation details operations. This includes + * @param scope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. - * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -54,11 +52,5 @@ ReservationRecommendationDetailsModel get( * @return reservation recommendation details. */ Response getWithResponse( - String billingScope, - Scope scope, - String region, - Term term, - LookBackPeriod lookBackPeriod, - String product, - Context context); + String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java index 0d44807be153..b696fec5806f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java @@ -45,12 +45,19 @@ public interface ReservationRecommendationDetailsModel { String sku(); /** - * Gets the etag property: Resource eTag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ String etag(); + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the currency property: An ISO 4217 currency code identifier for the costs and savings. * @@ -93,13 +100,6 @@ public interface ReservationRecommendationDetailsModel { */ ReservationRecommendationDetailsUsageProperties usage(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner * object. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java index 05751a1b2eb0..5de354242a73 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java @@ -34,12 +34,6 @@ public final class ReservationRecommendationsListResult { @JsonProperty(value = "previousLink", access = JsonProperty.Access.WRITE_ONLY) private String previousLink; - /* - * The total amount of cost. - */ - @JsonProperty(value = "totalCost", access = JsonProperty.Access.WRITE_ONLY) - private String totalCost; - /** * Get the value property: The list of reservation recommendations. * @@ -67,15 +61,6 @@ public String previousLink() { return this.previousLink; } - /** - * Get the totalCost property: The total amount of cost. - * - * @return the totalCost value. - */ - public String totalCost() { - return this.totalCost; - } - /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java index 3a1469244a12..b48e0e8e43e0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java @@ -32,6 +32,20 @@ public interface ReservationSummary { */ String type(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + /** * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The @@ -150,20 +164,6 @@ public interface ReservationSummary { */ BigDecimal utilizedPercentage(); - /** - * Gets the etag property: Resource etag. - * - * @return the etag value. - */ - String etag(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java index 02e3b3b47750..a5c07b494c6c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java @@ -91,10 +91,10 @@ PagedIterable listByReservationOrderAndReservation( * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @param grain Can be daily or monthly. - * @param startDate Start date. Required only when querying with billing profile. - * @param endDate End date. Required only when querying with billing profile. - * @param filter The properties/UsageDate for start date and end date. The filter supports 'le' and 'ge'. Not - * required when querying with billing profile. + * @param startDate Start date. Only applicable when querying with billing profile. + * @param endDate End date. Only applicable when querying with billing profile. + * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java deleted file mode 100644 index 288a61c2d473..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.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.consumption.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Defines values for Scope. */ -public final class Scope extends ExpandableStringEnum { - /** Static value Single for Scope. */ - public static final Scope SINGLE = fromString("Single"); - - /** Static value Shared for Scope. */ - public static final Scope SHARED = fromString("Shared"); - - /** - * Creates or finds a Scope from its string representation. - * - * @param name a name to look for. - * @return the corresponding Scope. - */ - @JsonCreator - public static Scope fromString(String name) { - return fromString(name, Scope.class); - } - - /** @return known Scope values. */ - public static Collection values() { - return values(Scope.class); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java new file mode 100644 index 000000000000..be3cc4f3b945 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Status. */ +public final class Status extends ExpandableStringEnum { + /** Static value None for Status. */ + public static final Status NONE = fromString("None"); + + /** Static value Active for Status. */ + public static final Status ACTIVE = fromString("Active"); + + /** Static value Inactive for Status. */ + public static final Status INACTIVE = fromString("Inactive"); + + /** Static value Expired for Status. */ + public static final Status EXPIRED = fromString("Expired"); + + /** Static value Complete for Status. */ + public static final Status COMPLETE = fromString("Complete"); + + /** Static value Canceled for Status. */ + public static final Status CANCELED = fromString("Canceled"); + + /** + * Creates or finds a Status from its string representation. + * + * @param name a name to look for. + * @return the corresponding Status. + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** @return known Status values. */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java index bb0504e39b81..779096aff19a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java @@ -30,6 +30,14 @@ public interface TagsResult { */ String type(); + /** + * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @return the etag value. + */ + String etag(); + /** * Gets the tags property: A list of Tag. * @@ -51,14 +59,6 @@ public interface TagsResult { */ String previousLink(); - /** - * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. - * - * @return the etag value. - */ - String etag(); - /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.TagsResultInner object. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java index e0bbf0f17769..f79d6b457641 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java @@ -31,7 +31,7 @@ public interface UsageDetail { String type(); /** - * Gets the etag property: Resource etag. + * Gets the etag property: The etag for the resource. * * @return the etag value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java index 86f32f3b004e..61734c007e49 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java @@ -11,8 +11,7 @@ public interface UsageDetails { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -40,8 +39,7 @@ public interface UsageDetails { /** * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or - * later. For more information on using this API, including how to specify a date range, please see: - * https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation. + * later. * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account @@ -62,7 +60,7 @@ public interface UsageDetails { * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. - * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/instanceName, + * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. 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 is separated by a colon (:). PublisherType Filter diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsListSamples.java deleted file mode 100644 index af5c88e5748e..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsListSamples.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.consumption; - -import com.azure.core.util.Context; - -/** Samples for Budgets List. */ -public final class BudgetsListSamples { - /** - * Sample code: BudgetsList. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/CreditsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/CreditsGetSamples.java deleted file mode 100644 index a5dc95a0c4b5..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/CreditsGetSamples.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.consumption; - -import com.azure.core.util.Context; - -/** Samples for Credits Get. */ -public final class CreditsGetSamples { - /** - * Sample code: CreditsBalanceSummary-Modern. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void creditsBalanceSummaryModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .credits() - .getWithResponse("providers/Microsoft.Billing/billingAccounts/1234:5678/customers/2468", Context.NONE); - } - - /** - * Sample code: CreditsBalanceSummaryByBillingProfile. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void creditsBalanceSummaryByBillingProfile( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .credits() - .getWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468", Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/EventsOperationListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/EventsOperationListSamples.java deleted file mode 100644 index 09a752cb2818..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/EventsOperationListSamples.java +++ /dev/null @@ -1,43 +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.consumption; - -import com.azure.core.util.Context; - -/** Samples for EventsOperation List. */ -public final class EventsOperationListSamples { - /** - * Sample code: EventsList-Modern. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void eventsListModern(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .eventsOperations() - .list( - "2019-09-01", - "2019-10-31", - "providers/Microsoft.Billing/billingAccounts/1234:5678/customers/4268", - Context.NONE); - } - - /** - * Sample code: EventsListByBillingProfile. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void eventsListByBillingProfile( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .eventsOperations() - .list( - "2019-09-01", - "2019-10-31", - "providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/4268", - Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ForecastsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ForecastsListSamples.java deleted file mode 100644 index 53b863325f4d..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ForecastsListSamples.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.consumption; - -import com.azure.core.util.Context; - -/** Samples for Forecasts List. */ -public final class ForecastsListSamples { - /** - * Sample code: ForecastsList. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void forecastsList(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.forecasts().list(null, Context.NONE); - } - - /** - * Sample code: ForecastsListFilterByDates. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void forecastsListFilterByDates( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .forecasts() - .list("properties/usagedate ge '2018-04-01' AND properties/usagedate le '2018-04-02'", Context.NONE); - } - - /** - * Sample code: ForecastsListFilterByGrain. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void forecastsListFilterByGrain( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.forecasts().list("properties/Grain eq 'Monthly'", Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/LotsOperationListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/LotsOperationListSamples.java deleted file mode 100644 index 97a53a1eab71..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/LotsOperationListSamples.java +++ /dev/null @@ -1,35 +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.consumption; - -import com.azure.core.util.Context; - -/** Samples for LotsOperation List. */ -public final class LotsOperationListSamples { - /** - * Sample code: LotsList-Modern. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void lotsListModern(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .lotsOperations() - .list("providers/Microsoft.Billing/billingAccounts/1234:5678/customers/2468", Context.NONE); - } - - /** - * Sample code: LotsListByBillingProfile. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void lotsListByBillingProfile( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .lotsOperations() - .list("providers/Microsoft.Billing/billingAccounts/1234:5678/billingProfiles/2468", Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetByBillingPeriodSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetByBillingPeriodSamples.java deleted file mode 100644 index 7fc7a53b45ff..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetByBillingPeriodSamples.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.consumption; - -import com.azure.core.util.Context; - -/** Samples for PriceSheet GetByBillingPeriod. */ -public final class PriceSheetGetByBillingPeriodSamples { - /** - * Sample code: PriceSheetForBillingPeriod. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void priceSheetForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); - } - - /** - * Sample code: PriceSheetExpand. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .priceSheets() - .getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationDetailsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationDetailsGetSamples.java deleted file mode 100644 index 3727863587a2..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationDetailsGetSamples.java +++ /dev/null @@ -1,93 +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.consumption; - -import com.azure.core.util.Context; -import com.azure.resourcemanager.consumption.models.LookBackPeriod; -import com.azure.resourcemanager.consumption.models.Scope; -import com.azure.resourcemanager.consumption.models.Term; - -/** Samples for ReservationRecommendationDetails Get. */ -public final class ReservationRecommendationDetailsGetSamples { - /** - * Sample code: ReservationRecommendationsBySubscription-Legacy. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void reservationRecommendationsBySubscriptionLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .reservationRecommendationDetails() - .getWithResponse( - "subscriptions/00000000-0000-0000-0000-00000000", - Scope.SINGLE, - "westus", - Term.P3Y, - LookBackPeriod.LAST30DAYS, - "Standard_DS13_v2", - Context.NONE); - } - - /** - * Sample code: ReservationRecommendationsByBillingProfile-Modern. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void reservationRecommendationsByBillingProfileModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .reservationRecommendationDetails() - .getWithResponse( - "providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-00000000:00000000-0000-0000-0000-00000000/billingProfiles/00000000-0000-0000-0000-00000000", - Scope.SHARED, - "australiaeast", - Term.P1Y, - LookBackPeriod.LAST7DAYS, - "Standard_B2s", - Context.NONE); - } - - /** - * Sample code: ReservationRecommendationsByResourceGroup-Legacy. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void reservationRecommendationsByResourceGroupLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .reservationRecommendationDetails() - .getWithResponse( - "subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup", - Scope.SINGLE, - "westus", - Term.P3Y, - LookBackPeriod.LAST30DAYS, - "Standard_DS13_v2", - Context.NONE); - } - - /** - * Sample code: ReservationRecommendationsByBillingAccount-Legacy. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void reservationRecommendationsByBillingAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .reservationRecommendationDetails() - .getWithResponse( - "providers/Microsoft.Billing/billingAccounts/000000", - Scope.SHARED, - "eastus", - Term.P1Y, - LookBackPeriod.LAST60DAYS, - "Standard_DS14_v2", - Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/TagsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/TagsGetSamples.java deleted file mode 100644 index b9c3f9c73494..000000000000 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/TagsGetSamples.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.consumption; - -import com.azure.core.util.Context; - -/** Samples for Tags Get. */ -public final class TagsGetSamples { - /** - * Sample code: Tags_Get. - * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. - */ - public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .tags() - .getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); - } -} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetByManagementGroupSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java similarity index 59% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetByManagementGroupSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java index 74a32ec3f733..fbea8d1490c7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetByManagementGroupSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for AggregatedCost GetByManagementGroup. */ public final class AggregatedCostGetByManagementGroupSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroupFilterByDate.json + */ /** * Sample code: AggregatedCostByManagementGroupFilterByDate. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void aggregatedCostByManagementGroupFilterByDate( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .aggregatedCosts() .getByManagementGroupWithResponse( "managementGroupForTest", @@ -24,16 +26,16 @@ public static void aggregatedCostByManagementGroupFilterByDate( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroup.json + */ /** * Sample code: AggregatedCostByManagementGroup. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void aggregatedCostByManagementGroup( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .aggregatedCosts() - .getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java similarity index 69% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java index 5603ae8b7ef3..f9e11290b568 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json + */ /** * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void aggregatedCostListForBillingPeriodByManagementGroup( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .aggregatedCosts() .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java similarity index 51% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetByBillingAccountSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java index 4470bf6bb6f9..4b788fd036c6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Balances GetByBillingAccount. */ public final class BalancesGetByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccount.json + */ /** * Sample code: Balances. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetForBillingPeriodByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java similarity index 50% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetForBillingPeriodByBillingAccountSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java index ca71a181c3c7..4d6ec139a0a8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BalancesGetForBillingPeriodByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Balances GetForBillingPeriodByBillingAccount. */ public final class BalancesGetForBillingPeriodByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccountForBillingPeriod.json + */ /** * Sample code: Balances. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsCreateOrUpdateSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java similarity index 90% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsCreateOrUpdateSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java index a0436f963542..52fa8dad2b91 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsCreateOrUpdateSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java @@ -2,7 +2,7 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.resourcemanager.consumption.models.BudgetComparisonExpression; import com.azure.resourcemanager.consumption.models.BudgetFilter; @@ -10,7 +10,6 @@ import com.azure.resourcemanager.consumption.models.BudgetOperatorType; import com.azure.resourcemanager.consumption.models.BudgetTimePeriod; import com.azure.resourcemanager.consumption.models.CategoryType; -import com.azure.resourcemanager.consumption.models.CultureCode; import com.azure.resourcemanager.consumption.models.Notification; import com.azure.resourcemanager.consumption.models.OperatorType; import com.azure.resourcemanager.consumption.models.ThresholdType; @@ -23,18 +22,20 @@ /** Samples for Budgets CreateOrUpdate. */ public final class BudgetsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreateOrUpdateBudget.json + */ /** * Sample code: CreateOrUpdateBudget. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void createOrUpdateBudget( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void createOrUpdateBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .budgets() .define("TestBudget") .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") + .withEtag("\"1d34d016a593709\"") .withCategory(CategoryType.COST) .withAmount(new BigDecimal("100.65")) .withTimeGrain(TimeGrainType.MONTHLY) @@ -82,9 +83,7 @@ public static void createOrUpdateBudget( Arrays .asList( "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) - .withThresholdType(ThresholdType.ACTUAL) - .withLocale(CultureCode.EN_US))) - .withEtag("\"1d34d016a593709\"") + .withThresholdType(ThresholdType.ACTUAL))) .create(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsDeleteSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java similarity index 62% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsDeleteSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java index d7afff9ad40b..05711c0d6537 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsDeleteSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Budgets Delete. */ public final class BudgetsDeleteSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/DeleteBudget.json + */ /** * Sample code: DeleteBudget. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .budgets() .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java similarity index 62% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsGetSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java index 51aebb888039..077d0e6279bd 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/BudgetsGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Budgets Get. */ public final class BudgetsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Budget.json + */ /** * Sample code: Budget. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .budgets() .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java new file mode 100644 index 000000000000..eaf7f20cf4d9 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.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.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for Budgets List. */ +public final class BudgetsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BudgetsList.json + */ + /** + * Sample code: BudgetsList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ChargesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java similarity index 63% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ChargesListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java index e69583440bbe..d7718f3dd3b7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ChargesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Charges List. */ public final class ChargesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccount.json + */ /** * Sample code: ChargesListByBillingAccount-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789", @@ -27,15 +29,17 @@ public static void chargesListByBillingAccountModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json + */ /** * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void changesForBillingPeriodByEnrollmentAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", @@ -46,15 +50,17 @@ public static void changesForBillingPeriodByEnrollmentAccountLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json + */ /** * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByCustomerIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789", @@ -65,15 +71,17 @@ public static void chargesListByBillingAccountGroupByCustomerIdModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfile.json + */ /** * Sample code: ChargesListByBillingProfile-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", @@ -84,15 +92,17 @@ public static void chargesListByBillingProfileModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileInvoiceSection.json + */ /** * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileInvoiceSectionModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425/invoiceSections/67890", @@ -103,15 +113,16 @@ public static void chargesListByBillingProfileInvoiceSectionModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernCustomer.json + */ /** * Sample code: ChargesListByCustomer-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByCustomerModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void chargesListByCustomerModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", @@ -122,15 +133,16 @@ public static void chargesListByCustomerModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForDepartmentFilterByStartEndDate.json + */ /** * Sample code: ChargesListByDepartment-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByDepartmentLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void chargesListByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", @@ -141,15 +153,17 @@ public static void chargesListByDepartmentLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json + */ /** * Sample code: ChargesListForEnrollmentAccount-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListForEnrollmentAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", @@ -160,15 +174,17 @@ public static void chargesListForEnrollmentAccountLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + */ /** * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", @@ -179,15 +195,17 @@ public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json + */ /** * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByBillingProfileIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789", @@ -198,15 +216,17 @@ public static void chargesListByBillingAccountGroupByBillingProfileIdModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json + */ /** * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", @@ -217,15 +237,17 @@ public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByDepartment.json + */ /** * Sample code: ChangesForBillingPeriodByDepartment-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void changesForBillingPeriodByDepartmentLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", @@ -236,15 +258,17 @@ public static void changesForBillingPeriodByDepartmentLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernInvoiceSectionId.json + */ /** * Sample code: ChargesListByInvoiceSectionId-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void chargesListByInvoiceSectionIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .charges() .listWithResponse( "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java new file mode 100644 index 000000000000..da4b6e060728 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.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.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for Credits Get. */ +public final class CreditsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreditSummaryByBillingProfile.json + */ + /** + * Sample code: CreditSummaryByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java new file mode 100644 index 000000000000..9aa86101d18e --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for EventsOperation ListByBillingAccount. */ +public final class EventsOperationListByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccount.json + */ + /** + * Sample code: EventsGetByBillingAccount. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccountWithFilters.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsGetByBillingAccountWithFilters( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .eventsOperations() + .listByBillingAccount( + "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java new file mode 100644 index 000000000000..00f8425f2f70 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.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.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for EventsOperation ListByBillingProfile. */ +public final class EventsOperationListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsListByBillingProfile.json + */ + /** + * Sample code: EventsListByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java new file mode 100644 index 000000000000..690b8b71a558 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByBillingAccount. */ +public final class LotsOperationListByBillingAccountSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccount.json + */ + /** + * Sample code: LotsListByBillingAccount. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccountWithFilters.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccountWithStatusFilter( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .lotsOperations() + .listByBillingAccount( + "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java new file mode 100644 index 000000000000..d7b969519c18 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.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.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByBillingProfile. */ +public final class LotsOperationListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingProfile.json + */ + /** + * Sample code: LotsListByBillingProfile. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/MarketplacesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java similarity index 51% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/MarketplacesListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java index 233eaacda3c7..a0a5c0d2dcde 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/MarketplacesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java @@ -2,138 +2,152 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for Marketplaces List. */ public final class MarketplacesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json + */ /** * Sample code: BillingAccountMarketplacesListForBillingPeriod. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingAccountMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json + */ /** * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesList.json + */ /** * Sample code: SubscriptionMarketplacesList. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void subscriptionMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccountList.json + */ /** * Sample code: EnrollmentAccountMarketplacesList. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json + */ /** * Sample code: DepartmentMarketplacesListForBillingPeriod. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void departmentMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .marketplaces() - .list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroupList.json + */ /** * Sample code: ManagementGroupMarketplacesList. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void managementGroupMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesListForBillingPeriod.json + */ /** * Sample code: SubscriptionMarketplacesListForBillingPeriod. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void subscriptionMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartmentList.json + */ /** * Sample code: DepartmentMarketplacesList. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void departmentMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager - .marketplaces() - .list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json + */ /** * Sample code: ManagementGroupMarketplacesListForBillingPeriod. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void managementGroupMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountList.json + */ /** * Sample code: BillingAccountMarketplacesList. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .marketplaces() .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java new file mode 100644 index 000000000000..2fd13c9b6894 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for PriceSheet GetByBillingPeriod. */ +public final class PriceSheetGetByBillingPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetForBillingPeriod.json + */ + /** + * Sample code: PriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetExpand.json + */ + /** + * Sample code: PriceSheetExpand. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java similarity index 51% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java index 287c0b5ec7e3..89d4b805d63e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/PriceSheetGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java @@ -2,19 +2,21 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for PriceSheet Get. */ public final class PriceSheetGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheet.json + */ /** * Sample code: PriceSheet. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager.priceSheets().getWithResponse(null, null, null, Context.NONE); + public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().getWithResponse(null, null, null, Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java new file mode 100644 index 000000000000..6ea6dcad3a88 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Term; + +/** Samples for ReservationRecommendationDetails Get. */ +public final class ReservationRecommendationDetailsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsBySubscription.json + */ + /** + * Sample code: ReservationRecommendationsBySubscription-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsBySubscriptionLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingProfile.json + */ + /** + * Sample code: ReservationRecommendationsByBillingProfile-Modern. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingProfileModern( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse( + "Shared", "australiaeast", Term.P1Y, LookBackPeriod.LAST7DAYS, "Standard_B2s", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByResourceGroup.json + */ + /** + * Sample code: ReservationRecommendationsByResourceGroup-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByResourceGroupLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingAccount.json + */ + /** + * Sample code: ReservationRecommendationsByBillingAccount-Legacy. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void reservationRecommendationsByBillingAccountLegacy( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .reservationRecommendationDetails() + .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java similarity index 62% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationsListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java index 67b44c616b77..138e5e91c894 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationRecommendationsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java @@ -2,60 +2,68 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationRecommendations List. */ public final class ReservationRecommendationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsBySubscription.json + */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsBySubscriptionLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationRecommendations() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json + */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingProfileModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationRecommendations() .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByResourceGroup.json + */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByResourceGroupLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationRecommendations() .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json + */ /** * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationRecommendations() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -63,15 +71,17 @@ public static void reservationRecommendationsFilterBySubscriptionForScopeLookBac Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json + */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationRecommendations() .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java similarity index 73% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListByBillingProfileSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java index 4e561828176a..fffde1dc985e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListByBillingProfileSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationTransactions ListByBillingProfile. */ public final class ReservationTransactionsListByBillingProfileSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByBillingProfileId.json + */ /** * Sample code: ReservationTransactionsByBillingProfileId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationTransactionsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationTransactions() .listByBillingProfile( "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java similarity index 67% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java index 85463f522ec6..c0153701ae27 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationTransactionsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationTransactions List. */ public final class ReservationTransactionsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByEnrollmentNumber.json + */ /** * Sample code: ReservationTransactionsByEnrollmentNumber. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationTransactionsByEnrollmentNumber( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationTransactions() .list("123456", "properties/eventDate+ge+2020-05-20+AND+properties/eventDate+le+2020-05-30", Context.NONE); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderAndReservationSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java similarity index 73% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderAndReservationSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java index 24df03be0225..3207aa8e9016 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderAndReservationSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ public final class ReservationsDetailsListByReservationOrderAndReservationSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsWithReservationId.json + */ /** * Sample code: ReservationDetailsWithReservationId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsDetails() .listByReservationOrderAndReservation( "00000000-0000-0000-0000-000000000000", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java similarity index 68% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java index 8a08e2714d39..5a3ac3508b85 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListByReservationOrderSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java @@ -2,20 +2,22 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationsDetails ListByReservationOrder. */ public final class ReservationsDetailsListByReservationOrderSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetails.json + */ /** * Sample code: ReservationDetails. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetails(com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void reservationDetails(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsDetails() .listByReservationOrder( "00000000-0000-0000-0000-000000000000", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java similarity index 69% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java index c00ee16b71b7..94c739663dee 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsDetailsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java @@ -2,21 +2,23 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; /** Samples for ReservationsDetails List. */ public final class ReservationsDetailsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileIdReservationId.json + */ /** * Sample code: ReservationDetailsByBillingProfileIdReservationId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsByBillingProfileIdReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsDetails() .list( "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", @@ -28,15 +30,17 @@ public static void reservationDetailsByBillingProfileIdReservationId( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingAccountId.json + */ /** * Sample code: ReservationDetailsByBillingAccountId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsByBillingAccountId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsDetails() .list( "providers/Microsoft.Billing/billingAccounts/12345", @@ -48,15 +52,17 @@ public static void reservationDetailsByBillingAccountId( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileId.json + */ /** * Sample code: ReservationDetailsByBillingProfileId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsDetails() .list( "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderAndReservationSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java similarity index 71% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderAndReservationSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java index 5f9cdbe669a3..cf09a00f17e5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderAndReservationSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ public final class ReservationsSummariesListByReservationOrderAndReservationSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithReservationId.json + */ /** * Sample code: ReservationSummariesDailyWithReservationId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .listByReservationOrderAndReservation( "00000000-0000-0000-0000-000000000000", @@ -27,15 +29,17 @@ public static void reservationSummariesDailyWithReservationId( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithReservationId.json + */ /** * Sample code: ReservationSummariesMonthlyWithReservationId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .listByReservationOrderAndReservation( "00000000-0000-0000-0000-000000000000", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java similarity index 56% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java index 8893490a381c..d5b722788fbd 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListByReservationOrderSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java @@ -2,35 +2,37 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrder. */ public final class ReservationsSummariesListByReservationOrderSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthly.json + */ /** * Sample code: ReservationSummariesMonthly. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesMonthly( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDaily.json + */ /** * Sample code: ReservationSummariesDaily. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesDaily( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void reservationSummariesDaily(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .listByReservationOrder( "00000000-0000-0000-0000-000000000000", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java similarity index 67% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java index abfe45aa2261..7289882cd5a3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/ReservationsSummariesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java @@ -2,22 +2,24 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries List. */ public final class ReservationsSummariesListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingAccountId.json + */ /** * Sample code: ReservationSummariesDailyWithBillingAccountId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingAccountId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .list( "providers/Microsoft.Billing/billingAccounts/12345", @@ -30,15 +32,17 @@ public static void reservationSummariesDailyWithBillingAccountId( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingProfileId.json + */ /** * Sample code: ReservationSummariesDailyWithBillingProfileId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .list( "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", @@ -51,63 +55,69 @@ public static void reservationSummariesDailyWithBillingProfileId( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json + */ /** * Sample code: ReservationSummariesMonthlyWithBillingAccountId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingAccountId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .list( "providers/Microsoft.Billing/billingAccounts/12345", Datagrain.MONTHLY, null, null, - "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", + null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json + */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .list( "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, - "2017-10-01", - "2017-11-20", + null, + null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileIdReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .reservationsSummaries() .list( "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, - "2017-10-01", - "2017-11-20", + null, + null, null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java new file mode 100644 index 000000000000..be0a881edbe4 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.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.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for Tags Get. */ +public final class TagsGetSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Tags.json + */ + /** + * Sample code: Tags_Get. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/UsageDetailsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java similarity index 61% rename from sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/UsageDetailsListSamples.java rename to sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java index 2051ba120b0a..3286358ace12 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/UsageDetailsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java @@ -2,35 +2,39 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption; +package com.azure.resourcemanager.consumption.generated; import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Metrictype; /** Samples for UsageDetails List. */ public final class UsageDetailsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json + */ /** * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingAccountUsageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCAInvoiceSection.json + */ /** * Sample code: InvoiceSectionUsageDetailsList-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void invoiceSectionUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", @@ -42,28 +46,31 @@ public static void invoiceSectionUsageDetailsListModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsList.json + */ /** * Sample code: UsageDetailsList-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListFilterByTag.json + */ /** * Sample code: UsageDetailsListFilterByTag-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListFilterByTagLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -75,28 +82,32 @@ public static void usageDetailsListFilterByTagLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByBillingAccount.json + */ /** * Sample code: BillingAccountUsageDetailsList-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingProfile.json + */ /** * Sample code: BillingProfileUsageDetailsList-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingProfileUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", @@ -108,41 +119,47 @@ public static void billingProfileUsageDetailsListModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByDepartment.json + */ /** * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void departmentUsageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json + */ /** * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void managementGroupUsageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricAmortizedCost.json + */ /** * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListByMetricAmortizedCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -154,15 +171,17 @@ public static void usageDetailsListByMetricAmortizedCostLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricUsage.json + */ /** * Sample code: UsageDetailsListByMetricUsage-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListByMetricUsageLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -174,41 +193,47 @@ public static void usageDetailsListByMetricUsageLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByManagementGroup.json + */ /** * Sample code: ManagementGroupUsageDetailsList-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void managementGroupUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByDepartment.json + */ /** * Sample code: DepartmentUsageDetailsList-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void departmentUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricActualCost.json + */ /** * Sample code: UsageDetailsListByMetricActualCost-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListByMetricActualCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -220,41 +245,47 @@ public static void usageDetailsListByMetricActualCostLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByEnrollmentAccount.json + */ /** * Sample code: EnrollmentAccountUsageDetailsList-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingAccount.json + */ /** * Sample code: BillingAccountUsageDetailsList-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void billingAccountUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCACustomer.json + */ /** * Sample code: CustomerUsageDetailsList-Modern. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void customerUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000", @@ -266,15 +297,16 @@ public static void customerUsageDetailsListModern( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsExpand.json + */ /** * Sample code: UsageDetailsExpand-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsExpandLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + public static void usageDetailsExpandLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list( "subscriptions/00000000-0000-0000-0000-000000000000", @@ -286,28 +318,32 @@ public static void usageDetailsExpandLegacy( Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json + */ /** * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountUsageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriod.json + */ /** * Sample code: UsageDetailsListForBillingPeriod-Legacy. * - * @param consumptionManager Entry point to ConsumptionManager. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager consumptionManager) { - consumptionManager + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager .usageDetails() .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); }