From 60ffa1c623844b6dfc41aa890b4db91a544a81b2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 26 Jul 2021 23:39:15 +0000 Subject: [PATCH] CodeGen from PR 15325 in Azure/azure-rest-api-specs Merge c8dbaad882b1db8397a19657585d12037603a961 into bea659d448f0195819a326dfefa5a2364ac0171b --- .../CHANGELOG.md | 3 +- .../README.md | 5 +- .../azure-resourcemanager-consumption/pom.xml | 2 +- .../consumption/ConsumptionManager.java | 2 +- .../consumption/fluent/CreditsClient.java | 18 +- .../fluent/EventsOperationsClient.java | 56 ++- .../fluent/LotsOperationsClient.java | 55 ++- .../consumption/fluent/PriceSheetsClient.java | 10 +- ...eservationRecommendationDetailsClient.java | 14 +- .../fluent/ReservationsSummariesClient.java | 8 +- .../fluent/UsageDetailsClient.java | 8 +- .../fluent/models/BalanceInner.java | 4 +- .../fluent/models/CreditSummaryInner.java | 68 +-- .../fluent/models/EventSummaryInner.java | 369 +++++++++------ .../fluent/models/ForecastInner.java | 4 +- .../fluent/models/LotSummaryInner.java | 187 ++++---- ...agementGroupAggregatedCostResultInner.java | 4 +- .../fluent/models/MarketplaceInner.java | 6 +- .../fluent/models/PriceSheetResultInner.java | 4 +- .../fluent/models/ReservationDetailInner.java | 4 +- ...vationRecommendationDetailsModelInner.java | 41 +- .../ReservationRecommendationInner.java | 40 +- .../models/ReservationSummaryInner.java | 4 +- .../fluent/models/UsageDetailInner.java | 4 +- .../AggregatedCostsClientImpl.java | 2 +- .../implementation/BalancesClientImpl.java | 4 +- .../ConsumptionManagementClientImpl.java | 2 +- .../implementation/CreditSummaryImpl.java | 16 +- .../implementation/CreditsClientImpl.java | 97 ++-- .../implementation/CreditsImpl.java | 9 +- .../implementation/EventSummaryImpl.java | 76 +-- .../EventsOperationsClientImpl.java | 433 +++++++++++++++--- .../implementation/EventsOperationsImpl.java | 23 +- .../implementation/LotSummaryImpl.java | 41 +- .../LotsOperationsClientImpl.java | 428 ++++++++++++++--- .../implementation/LotsOperationsImpl.java | 22 +- .../implementation/PriceSheetsClientImpl.java | 30 +- ...vationRecommendationDetailsClientImpl.java | 62 +-- .../ReservationRecommendationDetailsImpl.java | 10 +- ...rvationRecommendationDetailsModelImpl.java | 8 +- .../ReservationRecommendationImpl.java | 20 +- .../ReservationsSummariesClientImpl.java | 40 +- .../UsageDetailsClientImpl.java | 31 +- .../consumption/models/Amount.java | 2 +- .../models/AmountWithExchangeRate.java | 18 +- .../consumption/models/Balance.java | 2 +- .../consumption/models/ChargeSummary.java | 4 +- .../models/CreditBalanceSummary.java | 22 +- .../consumption/models/CreditSummary.java | 32 +- .../consumption/models/Credits.java | 18 +- .../consumption/models/CultureCode.java | 91 ---- .../consumption/models/EventSummary.java | 142 ++++-- .../consumption/models/EventsOperations.java | 54 ++- .../consumption/models/Forecast.java | 2 +- .../consumption/models/LegacyUsageDetail.java | 12 +- .../consumption/models/LotSource.java | 3 + .../consumption/models/LotSummary.java | 79 ++-- .../consumption/models/LotsOperations.java | 52 ++- .../ManagementGroupAggregatedCostResult.java | 2 +- .../consumption/models/Marketplace.java | 2 +- .../ModernReservationRecommendation.java | 45 -- .../consumption/models/ModernUsageDetail.java | 13 +- .../consumption/models/Notification.java | 26 -- .../consumption/models/PriceSheetResult.java | 2 +- .../consumption/models/PriceSheets.java | 10 +- .../consumption/models/Reseller.java | 10 +- .../consumption/models/ReservationDetail.java | 2 +- .../models/ReservationRecommendation.java | 35 +- .../ReservationRecommendationDetails.java | 14 +- ...ReservationRecommendationDetailsModel.java | 14 +- .../ReservationRecommendationsListResult.java | 15 - .../models/ReservationSummary.java | 2 +- .../models/ReservationsSummaries.java | 8 +- .../consumption/models/Status.java | 46 ++ .../consumption/models/UsageDetail.java | 2 +- .../consumption/models/UsageDetails.java | 8 +- 76 files changed, 1955 insertions(+), 1108 deletions(-) delete mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CultureCode.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index 6c9b32b12cfa..9a9d5a2b8ae2 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-07-26) +- 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-05. 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..64fe1c8e9d7b 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-05. 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}) @@ -74,7 +74,6 @@ See [API design][design] for general introduction on design and key concepts on ## Examples -[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md) ## Troubleshooting diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml index 87e3018d6dd6..d737364e0e00 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-05. 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..ec3a92dea971 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 @@ -241,7 +241,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(" (") 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/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..99f9b7299835 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 @@ -20,13 +20,13 @@ 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 scope1 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 +39,18 @@ public interface ReservationRecommendationDetailsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) ReservationRecommendationDetailsModelInner get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, Scope scope1, 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 scope1 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,8 +64,8 @@ ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, 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..6c0dbc7e5e9d 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 @@ -115,7 +115,7 @@ public class BalanceInner extends ProxyResource { private List adjustmentDetails; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -274,7 +274,7 @@ public List adjustmentDetails() { } /** - * 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/fluent/models/CreditSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java index c97cdbff92b4..2bc546a83179 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 @@ -21,18 +21,6 @@ public class CreditSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryInner.class); - /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - /* * Summary of balances associated with this credit summary. */ @@ -58,13 +46,25 @@ public class CreditSummaryInner extends ProxyResource { private Amount pendingEligibleCharges; /* - * Reseller details. + * The credit currency. + */ + @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; + + /* + * The billing currency. + */ + @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * Credit's reseller. */ @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; @@ -75,24 +75,6 @@ public class CreditSummaryInner extends ProxyResource { @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) private Map tags; - /** - * Get the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - public String creditCurrency() { - return this.creditCurrency; - } - - /** - * Get the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - public String billingCurrency() { - return this.billingCurrency; - } - /** * Get the balanceSummary property: Summary of balances associated with this credit summary. * @@ -130,7 +112,25 @@ public Amount pendingEligibleCharges() { } /** - * Get the reseller property: Reseller details. + * 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. */ @@ -139,7 +139,7 @@ public Reseller reseller() { } /** - * 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/fluent/models/EventSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java index 61d57e52f495..4cdc034a7967 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 @@ -24,109 +24,151 @@ public class EventSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSummaryInner.class); /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Transaction date. + * The date of the event. */ @JsonProperty(value = "properties.transactionDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime transactionDate; /* - * Transaction description. + * The description of the event. */ @JsonProperty(value = "properties.description", access = JsonProperty.Access.WRITE_ONLY) private String description; /* - * New Credit. + * The amount of new credit or commitment for NewCredit or SettleCharges + * event. */ @JsonProperty(value = "properties.newCredit", access = JsonProperty.Access.WRITE_ONLY) private Amount newCredit; /* - * Current balance. + * The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. */ - @JsonProperty(value = "properties.newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate newCreditInBillingCurrency; + @JsonProperty(value = "properties.adjustments", access = JsonProperty.Access.WRITE_ONLY) + private Amount adjustments; /* - * Adjustments amount. + * The amount of expired credit or commitment for NewCredit or + * SettleCharges event. */ - @JsonProperty(value = "properties.adjustments", access = JsonProperty.Access.WRITE_ONLY) - private Amount adjustments; + @JsonProperty(value = "properties.creditExpired", access = JsonProperty.Access.WRITE_ONLY) + private Amount creditExpired; /* - * Current balance. + * The amount of charges for events of type SettleCharges and + * PendingEligibleCharges. */ - @JsonProperty(value = "properties.adjustmentsInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate adjustmentsInBillingCurrency; + @JsonProperty(value = "properties.charges", access = JsonProperty.Access.WRITE_ONLY) + private Amount charges; /* - * Credit expired. + * The balance after the event. */ - @JsonProperty(value = "properties.creditExpired", access = JsonProperty.Access.WRITE_ONLY) - private Amount creditExpired; + @JsonProperty(value = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Amount closedBalance; /* - * Current balance. + * Identifies the type of the event. */ - @JsonProperty(value = "properties.creditExpiredInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate creditExpiredInBillingCurrency; + @JsonProperty(value = "properties.eventType") + private EventType eventType; /* - * Charges amount. + * The number which uniquely identifies the invoice on which the event was + * billed. This will be empty for unbilled events. */ - @JsonProperty(value = "properties.charges", access = JsonProperty.Access.WRITE_ONLY) - private Amount charges; + @JsonProperty(value = "properties.invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) + private String invoiceNumber; /* - * Current balance. + * 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 = "properties.chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate chargesInBillingCurrency; + @JsonProperty(value = "properties.billingProfileId", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileId; /* - * Closed balance. + * 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 = "properties.closedBalance", access = JsonProperty.Access.WRITE_ONLY) - private Amount closedBalance; + @JsonProperty(value = "properties.billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingProfileDisplayName; /* - * Current balance. + * The ID that uniquely identifies the lot for which the event happened. */ - @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private AmountWithExchangeRate closedBalanceInBillingCurrency; + @JsonProperty(value = "properties.lotId", access = JsonProperty.Access.WRITE_ONLY) + private String lotId; /* - * The type of event. + * Identifies the source of the lot for which the event happened. */ - @JsonProperty(value = "properties.eventType") - private EventType eventType; + @JsonProperty(value = "properties.lotSource", access = JsonProperty.Access.WRITE_ONLY) + private String lotSource; /* - * Invoice number. + * Amount of canceled credit. */ - @JsonProperty(value = "properties.invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) - private String invoiceNumber; + @JsonProperty(value = "properties.canceledCredit", access = JsonProperty.Access.WRITE_ONLY) + private Amount canceledCredit; + + /* + * The credit currency of the event. + */ + @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; /* - * Reseller details. + * The billing currency of the event. + */ + @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * The reseller of the event. */ @JsonProperty(value = "properties.reseller", access = JsonProperty.Access.WRITE_ONLY) private Reseller reseller; /* - * Resource etag. + * The amount of expired credit or commitment for NewCredit or + * SettleCharges event in billing currency. + */ + @JsonProperty(value = "properties.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 = "properties.newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate newCreditInBillingCurrency; + + /* + * The amount of balance adjustment in billing currency. + */ + @JsonProperty(value = "properties.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 = "properties.chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate chargesInBillingCurrency; + + /* + * The balance in billing currency after the event. + */ + @JsonProperty(value = "properties.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; @@ -138,162 +180,166 @@ public class EventSummaryInner extends ProxyResource { private Map tags; /** - * Get the creditCurrency property: Credit Currency. + * Get the transactionDate property: The date of the event. * - * @return the creditCurrency value. + * @return the transactionDate value. */ - public String creditCurrency() { - return this.creditCurrency; + public OffsetDateTime transactionDate() { + return this.transactionDate; } /** - * Get the billingCurrency property: Billing Currency. + * Get the description property: The description of the event. * - * @return the billingCurrency value. + * @return the description value. */ - public String billingCurrency() { - return this.billingCurrency; + public String description() { + return this.description; } /** - * Get the transactionDate property: Transaction date. + * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. * - * @return the transactionDate value. + * @return the newCredit value. */ - public OffsetDateTime transactionDate() { - return this.transactionDate; + public Amount newCredit() { + return this.newCredit; } /** - * Get the description property: Transaction description. + * Get the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. * - * @return the description value. + * @return the adjustments value. */ - public String description() { - return this.description; + public Amount adjustments() { + return this.adjustments; } /** - * Get the newCredit property: New Credit. + * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * - * @return the newCredit value. + * @return the creditExpired value. */ - public Amount newCredit() { - return this.newCredit; + public Amount creditExpired() { + return this.creditExpired; } /** - * Get the newCreditInBillingCurrency property: Current balance. + * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * - * @return the newCreditInBillingCurrency value. + * @return the charges value. */ - public AmountWithExchangeRate newCreditInBillingCurrency() { - return this.newCreditInBillingCurrency; + public Amount charges() { + return this.charges; } /** - * Get the adjustments property: Adjustments amount. + * Get the closedBalance property: The balance after the event. * - * @return the adjustments value. + * @return the closedBalance value. */ - public Amount adjustments() { - return this.adjustments; + public Amount closedBalance() { + return this.closedBalance; } /** - * Get the adjustmentsInBillingCurrency property: Current balance. + * Get the eventType property: Identifies the type of the event. * - * @return the adjustmentsInBillingCurrency value. + * @return the eventType value. */ - public AmountWithExchangeRate adjustmentsInBillingCurrency() { - return this.adjustmentsInBillingCurrency; + public EventType eventType() { + return this.eventType; } /** - * Get the creditExpired property: Credit expired. + * Set the eventType property: Identifies the type of the event. * - * @return the creditExpired value. + * @param eventType the eventType value to set. + * @return the EventSummaryInner object itself. */ - public Amount creditExpired() { - return this.creditExpired; + public EventSummaryInner withEventType(EventType eventType) { + this.eventType = eventType; + return this; } /** - * Get the creditExpiredInBillingCurrency 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 creditExpiredInBillingCurrency value. + * @return the invoiceNumber value. */ - public AmountWithExchangeRate creditExpiredInBillingCurrency() { - return this.creditExpiredInBillingCurrency; + public String invoiceNumber() { + return this.invoiceNumber; } /** - * Get the charges property: Charges 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 charges value. + * @return the billingProfileId value. */ - public Amount charges() { - return this.charges; + public String billingProfileId() { + return this.billingProfileId; } /** - * Get the chargesInBillingCurrency 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 chargesInBillingCurrency value. + * @return the billingProfileDisplayName value. */ - public AmountWithExchangeRate chargesInBillingCurrency() { - return this.chargesInBillingCurrency; + public String billingProfileDisplayName() { + return this.billingProfileDisplayName; } /** - * Get the closedBalance property: Closed balance. + * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. * - * @return the closedBalance value. + * @return the lotId value. */ - public Amount closedBalance() { - return this.closedBalance; + public String lotId() { + return this.lotId; } /** - * Get the closedBalanceInBillingCurrency property: Current balance. + * Get the lotSource property: Identifies the source of the lot for which the event happened. * - * @return the closedBalanceInBillingCurrency value. + * @return the lotSource value. */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; + public String lotSource() { + return this.lotSource; } /** - * Get the eventType property: The type of event. + * Get the canceledCredit property: Amount of canceled credit. * - * @return the eventType value. + * @return the canceledCredit value. */ - public EventType eventType() { - return this.eventType; + public Amount canceledCredit() { + return this.canceledCredit; } /** - * Set the eventType property: The type of event. + * Get the creditCurrency property: The credit currency of the event. * - * @param eventType the eventType value to set. - * @return the EventSummaryInner object itself. + * @return the creditCurrency value. */ - public EventSummaryInner withEventType(EventType eventType) { - this.eventType = eventType; - return this; + public String creditCurrency() { + return this.creditCurrency; } /** - * Get the invoiceNumber property: Invoice number. + * Get the billingCurrency property: The billing currency of the event. * - * @return the invoiceNumber value. + * @return the billingCurrency value. */ - public String invoiceNumber() { - return this.invoiceNumber; + public String billingCurrency() { + return this.billingCurrency; } /** - * Get the reseller property: Reseller details. + * Get the reseller property: The reseller of the event. * * @return the reseller value. */ @@ -302,7 +348,55 @@ public Reseller reseller() { } /** - * Get the etag property: Resource etag. + * 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. */ @@ -328,35 +422,38 @@ 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 (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/ForecastInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ForecastInner.java index 2815eea54078..0b3555b00f3f 100644 --- 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 @@ -64,7 +64,7 @@ public class ForecastInner extends ProxyResource { private List confidenceLevels; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -157,7 +157,7 @@ public List confidenceLevels() { } /** - * 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/fluent/models/LotSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java index a0ebd141f5a4..cc760db464bd 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 @@ -12,6 +12,7 @@ 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; @@ -24,73 +25,86 @@ public class LotSummaryInner extends ProxyResource { @JsonIgnore private final ClientLogger logger = new ClientLogger(LotSummaryInner.class); /* - * Credit Currency - */ - @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String creditCurrency; - - /* - * Billing Currency. - */ - @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) - private String billingCurrency; - - /* - * Original amount. + * The original amount of a lot. */ @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. + * The balance as of the last invoice. */ @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. + * The source of the lot. */ @JsonProperty(value = "properties.source", access = JsonProperty.Access.WRITE_ONLY) private LotSource source; /* - * Start date. + * The date when the lot became effective. */ @JsonProperty(value = "properties.startDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime startDate; /* - * Expiration date. + * The expiration date of a lot. */ @JsonProperty(value = "properties.expirationDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime expirationDate; /* - * PO number. + * The po number of the invoice on which the lot was added. This property + * is not available for ConsumptionCommitment lots. */ @JsonProperty(value = "properties.poNumber", access = JsonProperty.Access.WRITE_ONLY) private String poNumber; /* - * Reseller details. + * The date when the lot was added. + */ + @JsonProperty(value = "properties.purchaseDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime purchaseDate; + + /* + * The status of the lot. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /* + * The currency of the lot. + */ + @JsonProperty(value = "properties.creditCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String creditCurrency; + + /* + * The billing currency of the lot. + */ + @JsonProperty(value = "properties.billingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private String billingCurrency; + + /* + * The original amount of a lot in billing currency. + */ + @JsonProperty(value = "properties.originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate originalAmountInBillingCurrency; + + /* + * The balance as of the last invoice in billing currency. + */ + @JsonProperty(value = "properties.closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) + private AmountWithExchangeRate closedBalanceInBillingCurrency; + + /* + * The reseller of the lot. */ @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; @@ -102,97 +116,116 @@ public class LotSummaryInner extends ProxyResource { private Map tags; /** - * Get the creditCurrency property: Credit Currency. + * Get the originalAmount property: The original amount of a lot. * - * @return the creditCurrency value. + * @return the originalAmount value. */ - public String creditCurrency() { - return this.creditCurrency; + public Amount originalAmount() { + return this.originalAmount; } /** - * Get the billingCurrency property: Billing Currency. + * Get the closedBalance property: The balance as of the last invoice. * - * @return the billingCurrency value. + * @return the closedBalance value. */ - public String billingCurrency() { - return this.billingCurrency; + public Amount closedBalance() { + return this.closedBalance; } /** - * Get the originalAmount property: Original amount. + * Get the source property: The source of the lot. * - * @return the originalAmount value. + * @return the source value. */ - public Amount originalAmount() { - return this.originalAmount; + public LotSource source() { + return this.source; } /** - * Get the originalAmountInBillingCurrency property: Current balance. + * Get the startDate property: The date when the lot became effective. * - * @return the originalAmountInBillingCurrency value. + * @return the startDate value. */ - public AmountWithExchangeRate originalAmountInBillingCurrency() { - return this.originalAmountInBillingCurrency; + public OffsetDateTime startDate() { + return this.startDate; } /** - * Get the closedBalance property: Closed balance. + * Get the expirationDate property: The expiration date of a lot. * - * @return the closedBalance value. + * @return the expirationDate value. */ - public Amount closedBalance() { - return this.closedBalance; + public OffsetDateTime expirationDate() { + return this.expirationDate; } /** - * Get the closedBalanceInBillingCurrency property: Current balance. + * 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 closedBalanceInBillingCurrency value. + * @return the poNumber value. */ - public AmountWithExchangeRate closedBalanceInBillingCurrency() { - return this.closedBalanceInBillingCurrency; + public String poNumber() { + return this.poNumber; } /** - * Get the source property: Lot source. + * Get the purchaseDate property: The date when the lot was added. * - * @return the source value. + * @return the purchaseDate value. */ - public LotSource source() { - return this.source; + public OffsetDateTime purchaseDate() { + return this.purchaseDate; } /** - * Get the startDate property: Start date. + * Get the status property: The status of the lot. * - * @return the startDate value. + * @return the status value. */ - public OffsetDateTime startDate() { - return this.startDate; + public Status status() { + return this.status; } /** - * Get the expirationDate property: Expiration date. + * Get the creditCurrency property: The currency of the lot. * - * @return the expirationDate value. + * @return the creditCurrency value. */ - public OffsetDateTime expirationDate() { - return this.expirationDate; + public String creditCurrency() { + return this.creditCurrency; } /** - * Get the poNumber property: PO number. + * Get the billingCurrency property: The billing currency of the lot. * - * @return the poNumber value. + * @return the billingCurrency value. */ - public String poNumber() { - return this.poNumber; + 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 reseller property: Reseller details. + * 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. */ @@ -201,7 +234,7 @@ public Reseller reseller() { } /** - * Get the etag property: Resource etag. + * Get the etag property: The etag for the resource. * * @return the etag value. */ @@ -227,12 +260,12 @@ public void validate() { if (originalAmount() != null) { originalAmount().validate(); } - if (originalAmountInBillingCurrency() != null) { - originalAmountInBillingCurrency().validate(); - } if (closedBalance() != null) { closedBalance().validate(); } + if (originalAmountInBillingCurrency() != null) { + originalAmountInBillingCurrency().validate(); + } if (closedBalanceInBillingCurrency() != null) { closedBalanceInBillingCurrency().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..a6f0e9ca3d31 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 @@ -85,7 +85,7 @@ public class ManagementGroupAggregatedCostResultInner extends ProxyResource { private List excludedSubscriptions; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -225,7 +225,7 @@ public ManagementGroupAggregatedCostResultInner withExcludedSubscriptions(List 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 +73,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..d2501656970b 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 @@ -127,7 +127,7 @@ public class ReservationSummaryInner extends ProxyResource { private BigDecimal utilizedPercentage; /* - * Resource etag. + * The etag for the resource. */ @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) private String etag; @@ -287,7 +287,7 @@ public BigDecimal utilizedPercentage() { } /** - * 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/fluent/models/UsageDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java index 1a8de7e134bb..c6f28e2d4f84 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 @@ -32,7 +32,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; @@ -44,7 +44,7 @@ public class UsageDetailInner extends ProxyResource { 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/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/ConsumptionManagementClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientImpl.java index 051fbfcaf5ff..6b0a88ae78af 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 @@ -365,7 +365,7 @@ public CreditsClient getCredits() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-10-01"; + this.apiVersion = "2021-05-01"; this.usageDetails = new UsageDetailsClientImpl(this); this.marketplaces = new MarketplacesClientImpl(this); this.budgets = new BudgetsClientImpl(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..2a94d77e6458 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,14 +35,6 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - public CreditBalanceSummary balanceSummary() { return this.innerModel().balanceSummary(); } @@ -59,6 +51,14 @@ public Amount pendingEligibleCharges() { return this.innerModel().pendingEligibleCharges(); } + public String creditCurrency() { + return this.innerModel().creditCurrency(); + } + + public String billingCurrency() { + return this.innerModel().billingCurrency(); + } + public Reseller reseller() { return this.innerModel().reseller(); } 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..7cd64a9b3bc2 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") + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" + + "/providers/Microsoft.Consumption/credits/balanceSummary") @ExpectedResponses({200}) @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..d16060b6b265 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,14 +37,6 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - public OffsetDateTime transactionDate() { return this.innerModel().transactionDate(); } @@ -57,42 +49,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,10 +73,58 @@ 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 AmountWithExchangeRate creditExpiredInBillingCurrency() { + return this.innerModel().creditExpiredInBillingCurrency(); + } + + 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 etag() { return this.innerModel().etag(); } 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/LotSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java index 0c55e93f5bfd..632375d86ef5 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,14 @@ public String type() { return this.innerModel().type(); } - public String creditCurrency() { - return this.innerModel().creditCurrency(); - } - - public String billingCurrency() { - return this.innerModel().billingCurrency(); - } - 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,6 +62,30 @@ public String poNumber() { return this.innerModel().poNumber(); } + public OffsetDateTime purchaseDate() { + return this.innerModel().purchaseDate(); + } + + public Status status() { + return this.innerModel().status(); + } + + 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(); } 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/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/ReservationRecommendationDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java index 57dcfac6d6fa..3b71df5b0c47 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 @@ -64,14 +64,14 @@ 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("scope") Scope scope1, @QueryParam("region") String region, @QueryParam("term") Term term, @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, @@ -83,13 +83,13 @@ 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 scope1 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,19 +102,19 @@ Mono> get( */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, Scope scope1, 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.")); } + if (scope1 == null) { + return Mono.error(new IllegalArgumentException("Parameter scope1 is required and cannot be null.")); + } if (region == null) { return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); } @@ -135,8 +135,8 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, + scope1, region, term, lookBackPeriod, @@ -149,13 +149,13 @@ 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 scope1 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,8 +169,8 @@ private Mono> getWithRespon */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, @@ -182,12 +182,12 @@ private Mono> getWithRespon 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.")); } + if (scope1 == null) { + return Mono.error(new IllegalArgumentException("Parameter scope1 is required and cannot be null.")); + } if (region == null) { return Mono.error(new IllegalArgumentException("Parameter region is required and cannot be null.")); } @@ -206,8 +206,8 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), - billingScope, scope, + scope1, region, term, lookBackPeriod, @@ -219,13 +219,13 @@ 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 scope1 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 +238,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, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getWithResponseAsync(scope, scope1, region, term, lookBackPeriod, product) .flatMap( (Response res) -> { if (res.getValue() != null) { @@ -253,13 +253,13 @@ 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 scope1 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 +272,20 @@ 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, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getAsync(scope, scope1, 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 scope1 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 +299,13 @@ public ReservationRecommendationDetailsModelInner get( */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { - return getWithResponseAsync(billingScope, scope, region, term, lookBackPeriod, product, context).block(); + return getWithResponseAsync(scope, scope1, 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..286c11dddcad 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 @@ -32,9 +32,9 @@ public ReservationRecommendationDetailsImpl( } public ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String scope, Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, String product) { ReservationRecommendationDetailsModelInner inner = - this.serviceClient().get(billingScope, scope, region, term, lookBackPeriod, product); + this.serviceClient().get(scope, scope1, region, term, lookBackPeriod, product); if (inner != null) { return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); } else { @@ -43,15 +43,15 @@ public ReservationRecommendationDetailsModel get( } public Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, 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, scope1, 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..63daa2d0fbcd 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 @@ -44,10 +44,6 @@ public String sku() { return this.innerModel().sku(); } - public String etag() { - return this.innerModel().etag(); - } - public String currency() { return this.innerModel().currency(); } @@ -72,6 +68,10 @@ public ReservationRecommendationDetailsUsageProperties usage() { return this.innerModel().usage(); } + public String etag() { + return this.innerModel().etag(); + } + public Map tags() { Map inner = this.innerModel().tags(); if (inner != null) { 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/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/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/Amount.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java index ee8a60d5cd91..60524468cafc 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Amount.java @@ -12,7 +12,7 @@ /** The amount plus currency . */ @Immutable -public class Amount { +public final class Amount { @JsonIgnore private final ClientLogger logger = new ClientLogger(Amount.class); /* 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..3d13362282f2 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 { +public final class AmountWithExchangeRate { @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; } @@ -50,8 +50,6 @@ public Float exchangeRateMonth() { * * @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/models/Balance.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java index 62a70684dccb..105bef6fd46a 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 @@ -139,7 +139,7 @@ public interface Balance { List adjustmentDetails(); /** - * 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/ChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java index 18d50dd1e9f3..e93310ccd0b5 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 @@ -30,7 +30,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; @@ -42,7 +42,7 @@ public class ChargeSummary extends ProxyResource { 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/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..5b681ad0bc38 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 @@ -30,20 +30,6 @@ public interface CreditSummary { */ String type(); - /** - * Gets the creditCurrency property: Credit Currency. - * - * @return the creditCurrency value. - */ - String creditCurrency(); - - /** - * Gets the billingCurrency property: Billing Currency. - * - * @return the billingCurrency value. - */ - String billingCurrency(); - /** * Gets the balanceSummary property: Summary of balances associated with this credit summary. * @@ -73,14 +59,28 @@ public interface CreditSummary { Amount pendingEligibleCharges(); /** - * Gets the reseller property: Reseller details. + * Gets the creditCurrency property: The credit currency. + * + * @return the creditCurrency value. + */ + String creditCurrency(); + + /** + * Gets the billingCurrency property: The billing currency. + * + * @return the billingCurrency value. + */ + String billingCurrency(); + + /** + * Gets the reseller property: Credit's reseller. * * @return the reseller value. */ Reseller reseller(); /** - * 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/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..b0ac9b3ec3cf 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,126 +32,168 @@ public interface EventSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. + * Gets the transactionDate property: The date of the event. * - * @return the creditCurrency value. + * @return the transactionDate value. */ - String creditCurrency(); + OffsetDateTime transactionDate(); /** - * Gets the billingCurrency property: Billing Currency. + * Gets the description property: The description of the event. * - * @return the billingCurrency value. + * @return the description value. */ - String billingCurrency(); + String description(); /** - * Gets the transactionDate property: Transaction date. + * Gets the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. * - * @return the transactionDate value. + * @return the newCredit value. */ - OffsetDateTime transactionDate(); + Amount newCredit(); /** - * Gets the description property: Transaction description. + * Gets the adjustments property: The amount of balance adjustment. The property is not available for + * ConsumptionCommitment lots. * - * @return the description value. + * @return the adjustments value. */ - String description(); + Amount adjustments(); /** - * Gets the newCredit property: New Credit. + * Gets the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. * - * @return the newCredit value. + * @return the creditExpired value. */ - Amount newCredit(); + Amount creditExpired(); /** - * Gets the newCreditInBillingCurrency property: Current balance. + * Gets the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. * - * @return the newCreditInBillingCurrency value. + * @return the charges value. */ - AmountWithExchangeRate newCreditInBillingCurrency(); + Amount charges(); /** - * Gets the adjustments property: Adjustments amount. + * Gets the closedBalance property: The balance after the event. * - * @return the adjustments value. + * @return the closedBalance value. */ - Amount adjustments(); + Amount closedBalance(); /** - * Gets the adjustmentsInBillingCurrency property: Current balance. + * Gets the eventType property: Identifies the type of the event. * - * @return the adjustmentsInBillingCurrency value. + * @return the eventType value. */ - AmountWithExchangeRate adjustmentsInBillingCurrency(); + EventType eventType(); /** - * Gets the creditExpired property: Credit expired. + * 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 creditExpired value. + * @return the invoiceNumber value. */ - Amount creditExpired(); + String invoiceNumber(); /** - * Gets the creditExpiredInBillingCurrency 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 creditExpiredInBillingCurrency value. + * @return the billingProfileId value. */ - AmountWithExchangeRate creditExpiredInBillingCurrency(); + String billingProfileId(); /** - * Gets the charges property: Charges amount. + * 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 charges value. + * @return the billingProfileDisplayName value. */ - Amount charges(); + String billingProfileDisplayName(); /** - * Gets the chargesInBillingCurrency property: Current balance. + * Gets the lotId property: The ID that uniquely identifies the lot for which the event happened. * - * @return the chargesInBillingCurrency value. + * @return the lotId value. */ - AmountWithExchangeRate chargesInBillingCurrency(); + String lotId(); /** - * Gets the closedBalance property: Closed balance. + * Gets the lotSource property: Identifies the source of the lot for which the event happened. * - * @return the closedBalance value. + * @return the lotSource value. */ - Amount closedBalance(); + String lotSource(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. + * Gets the canceledCredit property: Amount of canceled credit. * - * @return the closedBalanceInBillingCurrency value. + * @return the canceledCredit value. */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); + Amount canceledCredit(); /** - * Gets the eventType property: The type of event. + * Gets the creditCurrency property: The credit currency of the event. * - * @return the eventType value. + * @return the creditCurrency value. */ - EventType eventType(); + String creditCurrency(); /** - * Gets the invoiceNumber property: Invoice number. + * Gets the billingCurrency property: The billing currency of the event. * - * @return the invoiceNumber value. + * @return the billingCurrency value. */ - String invoiceNumber(); + String billingCurrency(); /** - * Gets the reseller property: Reseller details. + * 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 creditExpiredInBillingCurrency value. + */ + AmountWithExchangeRate creditExpiredInBillingCurrency(); + + /** + * Gets the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or + * SettleCharges event in billing currency. + * + * @return the newCreditInBillingCurrency value. + */ + 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 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/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 index 239f07802ff9..36b46f731baa 100644 --- 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 @@ -78,7 +78,7 @@ public interface Forecast { List confidenceLevels(); /** - * 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/LegacyUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java index ebddba41eaa8..31596934dddb 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 @@ -166,7 +166,7 @@ public class LegacyUsageDetail extends UsageDetailInner { private String consumedService; /* - * Azure resource manager resource identifier. + * Unique identifier of the Azure Resource Manager usage detail resource. */ @JsonProperty(value = "properties.resourceId", access = JsonProperty.Access.WRITE_ONLY) private String resourceId; @@ -178,13 +178,13 @@ public class LegacyUsageDetail extends UsageDetailInner { private String resourceName; /* - * Service Info 1. + * Service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo1; /* - * Service Info 2. + * Legacy field with optional service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo2; @@ -500,7 +500,7 @@ public String 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. */ @@ -518,7 +518,7 @@ public String resourceName() { } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ @@ -527,7 +527,7 @@ public String serviceInfo1() { } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ 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..0b9aa93bd33e 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,84 +32,99 @@ public interface LotSummary { String type(); /** - * Gets the creditCurrency property: Credit Currency. + * Gets the originalAmount property: The original amount of a lot. * - * @return the creditCurrency value. + * @return the originalAmount value. */ - String creditCurrency(); + Amount originalAmount(); /** - * Gets the billingCurrency property: Billing Currency. + * Gets the closedBalance property: The balance as of the last invoice. * - * @return the billingCurrency value. + * @return the closedBalance value. */ - String billingCurrency(); + Amount closedBalance(); /** - * Gets the originalAmount property: Original amount. + * Gets the source property: The source of the lot. * - * @return the originalAmount value. + * @return the source value. */ - Amount originalAmount(); + LotSource source(); /** - * Gets the originalAmountInBillingCurrency property: Current balance. + * Gets the startDate property: The date when the lot became effective. * - * @return the originalAmountInBillingCurrency value. + * @return the startDate value. */ - AmountWithExchangeRate originalAmountInBillingCurrency(); + OffsetDateTime startDate(); /** - * Gets the closedBalance property: Closed balance. + * Gets the expirationDate property: The expiration date of a lot. * - * @return the closedBalance value. + * @return the expirationDate value. */ - Amount closedBalance(); + OffsetDateTime expirationDate(); /** - * Gets the closedBalanceInBillingCurrency property: Current balance. + * 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 closedBalanceInBillingCurrency value. + * @return the poNumber value. */ - AmountWithExchangeRate closedBalanceInBillingCurrency(); + String poNumber(); /** - * Gets the source property: Lot source. + * Gets the purchaseDate property: The date when the lot was added. * - * @return the source value. + * @return the purchaseDate value. */ - LotSource source(); + OffsetDateTime purchaseDate(); /** - * Gets the startDate property: Start date. + * Gets the status property: The status of the lot. * - * @return the startDate value. + * @return the status value. */ - OffsetDateTime startDate(); + Status status(); /** - * Gets the expirationDate property: Expiration date. + * Gets the creditCurrency property: The currency of the lot. * - * @return the expirationDate value. + * @return the creditCurrency value. */ - OffsetDateTime expirationDate(); + String creditCurrency(); /** - * Gets the poNumber property: PO number. + * Gets the billingCurrency property: The billing currency of the lot. * - * @return the poNumber value. + * @return the billingCurrency value. */ - String poNumber(); + 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: Reseller details. + * Gets the reseller property: The reseller of the lot. * * @return the reseller value. */ Reseller reseller(); /** - * 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/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..dca4b9a5c37a 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 @@ -106,7 +106,7 @@ public interface ManagementGroupAggregatedCostResult { List excludedSubscriptions(); /** - * 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/Marketplace.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java index 7357eea22708..033f1ef22683 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 @@ -217,7 +217,7 @@ public interface Marketplace { Boolean isRecurringCharge(); /** - * 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/ModernReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java index b7493021a212..5554d9879767 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 @@ -25,12 +25,6 @@ public class ModernReservationRecommendation extends ReservationRecommendationInner { @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendation.class); - /* - * Resource eTag. - */ - @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) - private String etag; - /* * Resource Location. */ @@ -127,27 +121,6 @@ public class ModernReservationRecommendation extends ReservationRecommendationIn @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; - - /** - * Get the etag property: Resource eTag. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - /** * Get the locationPropertiesLocation property: Resource Location. * @@ -292,24 +265,6 @@ 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; - } - /** * Validates the instance. * 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..11612cf4a7ad 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 @@ -14,6 +14,7 @@ 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") @@ -97,7 +98,7 @@ public class ModernUsageDetail extends UsageDetailInner { * see productOrderName. */ @JsonProperty(value = "properties.meterId", access = JsonProperty.Access.WRITE_ONLY) - private String meterId; + private UUID meterId; /* * Identifies the name of the meter against which consumption is measured. @@ -186,13 +187,13 @@ public class ModernUsageDetail extends UsageDetailInner { private String consumedService; /* - * Service Info 1. + * Service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo1", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo1; /* - * Service Info 2. + * Legacy field with optional service-specific metadata. */ @JsonProperty(value = "properties.serviceInfo2", access = JsonProperty.Access.WRITE_ONLY) private String serviceInfo2; @@ -569,7 +570,7 @@ public String product() { * * @return the meterId value. */ - public String meterId() { + public UUID meterId() { return this.meterId; } @@ -696,7 +697,7 @@ public String consumedService() { } /** - * Get the serviceInfo1 property: Service Info 1. + * Get the serviceInfo1 property: Service-specific metadata. * * @return the serviceInfo1 value. */ @@ -705,7 +706,7 @@ public String serviceInfo1() { } /** - * Get the serviceInfo2 property: Service Info 2. + * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. * * @return the serviceInfo2 value. */ 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..ec23910b62b2 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 @@ -53,7 +53,7 @@ public interface PriceSheetResult { MeterDetails download(); /** - * 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/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/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..5fa9483dba29 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 @@ -117,7 +117,7 @@ public interface ReservationDetail { String kind(); /** - * 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/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..f129d984809e 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,13 @@ 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 scope1 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 +30,18 @@ public interface ReservationRecommendationDetails { * @return reservation recommendation details. */ ReservationRecommendationDetailsModel get( - String billingScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String scope, Scope scope1, 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 scope1 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,8 +54,8 @@ ReservationRecommendationDetailsModel get( * @return reservation recommendation details. */ Response getWithResponse( - String billingScope, - Scope scope, + String scope, + Scope scope1, String region, Term term, LookBackPeriod lookBackPeriod, 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..6d750597aa73 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 @@ -44,13 +44,6 @@ public interface ReservationRecommendationDetailsModel { */ String sku(); - /** - * Gets the etag property: Resource eTag. - * - * @return the etag value. - */ - String etag(); - /** * Gets the currency property: An ISO 4217 currency code identifier for the costs and savings. * @@ -93,6 +86,13 @@ public interface ReservationRecommendationDetailsModel { */ ReservationRecommendationDetailsUsageProperties usage(); + /** + * Gets the etag property: The etag for the resource. + * + * @return the etag value. + */ + String etag(); + /** * Gets the tags property: Resource tags. * 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..87d010ae1645 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 @@ -151,7 +151,7 @@ public interface ReservationSummary { BigDecimal utilizedPercentage(); /** - * 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/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/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/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