From f7318dcb852c598f59667462ece18af22ae96770 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 24 Jun 2022 23:42:40 +0000 Subject: [PATCH] CodeGen from PR 19598 in Azure/azure-rest-api-specs Merge 187704b35370e88ba19f6c69fc85620f6636f877 into 42ca0236ef14093f5aff0694efa34d5594e814a0 --- .../CHANGELOG.md | 4 +- .../README.md | 2 +- .../SAMPLE.md | 98 ++++- .../consumption/ConsumptionManager.java | 148 ++++++- .../fluent/AggregatedCostsClient.java | 4 +- .../consumption/fluent/BalancesClient.java | 4 +- .../consumption/fluent/BudgetsClient.java | 10 +- .../consumption/fluent/ChargesClient.java | 2 +- .../consumption/fluent/CreditsClient.java | 2 +- .../fluent/EventsOperationsClient.java | 8 +- .../fluent/LotsOperationsClient.java | 56 ++- .../fluent/MarketplacesClient.java | 4 +- .../consumption/fluent/OperationsClient.java | 4 +- .../consumption/fluent/PriceSheetsClient.java | 4 +- ...eservationRecommendationDetailsClient.java | 19 +- .../ReservationRecommendationsClient.java | 12 +- .../fluent/ReservationTransactionsClient.java | 37 +- .../fluent/ReservationsDetailsClient.java | 20 +- .../fluent/ReservationsSummariesClient.java | 20 +- .../consumption/fluent/TagsClient.java | 2 +- .../fluent/UsageDetailsClient.java | 4 +- .../fluent/models/BalanceInner.java | 4 - .../fluent/models/BalanceProperties.java | 4 - .../fluent/models/BudgetInner.java | 4 - .../fluent/models/BudgetProperties.java | 13 +- .../fluent/models/ChargesListResultInner.java | 4 - .../fluent/models/CreditSummaryInner.java | 4 - .../models/CreditSummaryProperties.java | 4 - .../fluent/models/EventProperties.java | 4 - .../fluent/models/EventSummaryInner.java | 4 - .../models/LegacyChargeSummaryProperties.java | 4 - ...cyReservationRecommendationProperties.java | 4 - ...egacyReservationTransactionProperties.java | 8 +- .../models/LegacyUsageDetailProperties.java | 34 +- .../fluent/models/LotProperties.java | 4 - .../fluent/models/LotSummaryInner.java | 4 - ...nagementGroupAggregatedCostProperties.java | 4 - ...agementGroupAggregatedCostResultInner.java | 4 - .../fluent/models/MarketplaceInner.java | 4 - .../fluent/models/MarketplaceProperties.java | 4 - .../models/ModernChargeSummaryProperties.java | 4 - ...rnReservationRecommendationProperties.java | 4 - .../ModernReservationTransactionInner.java | 9 +- ...odernReservationTransactionProperties.java | 8 +- .../models/ModernUsageDetailProperties.java | 4 - .../fluent/models/OperationInner.java | 4 - .../fluent/models/PriceSheetModel.java | 4 - .../fluent/models/PriceSheetResultInner.java | 4 - .../fluent/models/ReservationDetailInner.java | 4 - .../models/ReservationDetailProperties.java | 4 - ...vationRecommendationDetailsModelInner.java | 4 - ...vationRecommendationDetailsProperties.java | 4 - .../ReservationRecommendationInner.java | 4 - .../models/ReservationSummaryInner.java | 4 - .../models/ReservationSummaryProperties.java | 4 - .../models/ReservationTransactionInner.java | 6 +- .../fluent/models/TagProperties.java | 4 - .../fluent/models/TagsResultInner.java | 4 - .../fluent/models/UsageDetailInner.java | 4 - .../AggregatedCostsClientImpl.java | 52 +-- .../implementation/AggregatedCostsImpl.java | 3 +- .../implementation/BalancesClientImpl.java | 42 +- .../implementation/BalancesImpl.java | 3 +- .../implementation/BudgetsClientImpl.java | 66 ++- .../implementation/BudgetsImpl.java | 19 +- .../implementation/ChargesClientImpl.java | 31 +- .../implementation/ChargesImpl.java | 3 +- .../ConsumptionManagementClientBuilder.java | 34 +- .../ConsumptionManagementClientImpl.java | 13 +- .../implementation/CreditsClientImpl.java | 20 +- .../implementation/CreditsImpl.java | 3 +- .../EventsOperationsClientImpl.java | 45 +- .../implementation/EventsOperationsImpl.java | 3 +- .../LotsOperationsClientImpl.java | 389 +++++++++++++++--- .../implementation/LotsOperationsImpl.java | 15 +- .../MarketplacesClientImpl.java | 21 +- .../implementation/MarketplacesImpl.java | 3 +- .../implementation/OperationsClientImpl.java | 23 +- .../implementation/OperationsImpl.java | 3 +- .../implementation/PriceSheetsClientImpl.java | 65 +-- .../implementation/PriceSheetsImpl.java | 3 +- ...vationRecommendationDetailsClientImpl.java | 77 ++-- .../ReservationRecommendationDetailsImpl.java | 18 +- .../ReservationRecommendationsClientImpl.java | 89 ++-- .../ReservationRecommendationsImpl.java | 11 +- .../ReservationTransactionsClientImpl.java | 162 ++++++-- .../ReservationTransactionsImpl.java | 3 +- .../ReservationsDetailsClientImpl.java | 122 +++--- .../ReservationsDetailsImpl.java | 13 +- .../ReservationsSummariesClientImpl.java | 127 +++--- .../ReservationsSummariesImpl.java | 11 +- .../implementation/TagsClientImpl.java | 23 +- .../consumption/implementation/TagsImpl.java | 3 +- .../UsageDetailsClientImpl.java | 29 +- .../implementation/UsageDetailsImpl.java | 3 +- .../consumption/models/AggregatedCosts.java | 4 +- .../consumption/models/Amount.java | 4 - .../models/AmountWithExchangeRate.java | 4 - ...alancePropertiesAdjustmentDetailsItem.java | 4 - ...ancePropertiesNewPurchasesDetailsItem.java | 4 - .../consumption/models/Balances.java | 4 +- .../consumption/models/BillingFrequency.java | 6 +- .../models/BudgetComparisonExpression.java | 11 +- .../consumption/models/BudgetFilter.java | 33 -- .../models/BudgetFilterProperties.java | 4 - .../models/BudgetOperatorType.java | 6 +- .../consumption/models/BudgetTimePeriod.java | 7 +- .../consumption/models/Budgets.java | 14 +- .../consumption/models/BudgetsListResult.java | 4 - .../consumption/models/CategoryType.java | 6 +- .../consumption/models/ChargeSummary.java | 4 - .../consumption/models/ChargeSummaryKind.java | 6 +- .../consumption/models/Charges.java | 2 +- .../models/CreditBalanceSummary.java | 4 - .../consumption/models/Credits.java | 2 +- .../consumption/models/CultureCode.java | 6 +- .../consumption/models/CurrentSpend.java | 4 - .../consumption/models/Datagrain.java | 6 +- .../consumption/models/EventType.java | 9 +- .../consumption/models/Events.java | 4 - .../consumption/models/EventsOperations.java | 8 +- .../consumption/models/ForecastSpend.java | 4 - .../models/LegacyChargeSummary.java | 7 +- .../LegacyReservationRecommendation.java | 7 +- .../models/LegacyReservationTransaction.java | 4 - ...peReservationRecommendationProperties.java | 5 - ...peReservationRecommendationProperties.java | 5 - .../consumption/models/LegacyUsageDetail.java | 25 +- .../consumption/models/LookBackPeriod.java | 6 +- .../consumption/models/LotSource.java | 6 +- .../consumption/models/Lots.java | 4 - .../consumption/models/LotsOperations.java | 54 ++- .../consumption/models/Marketplaces.java | 4 +- .../models/MarketplacesListResult.java | 4 - .../consumption/models/MeterDetails.java | 4 - .../models/MeterDetailsResponse.java | 4 - .../consumption/models/Metrictype.java | 6 +- .../models/ModernChargeSummary.java | 7 +- .../ModernReservationRecommendation.java | 7 +- .../models/ModernReservationTransaction.java | 2 +- ...dernReservationTransactionsListResult.java | 4 - .../consumption/models/ModernUsageDetail.java | 7 +- .../consumption/models/Notification.java | 11 +- .../consumption/models/OperationDisplay.java | 4 - .../models/OperationListResult.java | 4 - .../consumption/models/Operations.java | 4 +- .../consumption/models/OperatorType.java | 6 +- .../models/PriceSheetProperties.java | 4 - .../consumption/models/PriceSheets.java | 4 +- .../consumption/models/PricingModelType.java | 6 +- .../consumption/models/Reseller.java | 4 - .../models/ReservationDetailsListResult.java | 4 - .../ReservationRecommendationDetails.java | 18 +- ...ionDetailsCalculatedSavingsProperties.java | 6 - ...commendationDetailsResourceProperties.java | 5 - ...ecommendationDetailsSavingsProperties.java | 5 - ...nRecommendationDetailsUsageProperties.java | 5 - .../models/ReservationRecommendationKind.java | 6 +- .../models/ReservationRecommendations.java | 12 +- .../ReservationRecommendationsListResult.java | 4 - .../ReservationSummariesListResult.java | 4 - .../models/ReservationTransaction.java | 2 +- .../ReservationTransactionResource.java | 4 - .../models/ReservationTransactions.java | 37 +- .../ReservationTransactionsListResult.java | 4 - .../models/ReservationsDetails.java | 20 +- .../models/ReservationsSummaries.java | 20 +- .../models/ResourceAttributes.java | 4 - .../consumption/models/Scope.java | 38 ++ .../consumption/models/SkuProperty.java | 4 - .../consumption/models/Status.java | 6 +- .../consumption/models/Tag.java | 4 - .../consumption/models/Tags.java | 2 +- .../consumption/models/Term.java | 6 +- .../consumption/models/ThresholdType.java | 6 +- .../consumption/models/TimeGrainType.java | 6 +- .../consumption/models/UsageDetails.java | 4 +- .../consumption/models/UsageDetailsKind.java | 6 +- .../models/UsageDetailsListResult.java | 4 - .../LotsOperationListByCustomerSamples.java | 37 ++ .../generated/OperationsListSamples.java | 22 + ...vationRecommendationDetailsGetSamples.java | 36 +- 182 files changed, 1740 insertions(+), 1214 deletions(-) create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java create mode 100644 sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index b713d35da2ba..90174fc67c97 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md +++ b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.1 (2022-06-24) + +- Azure Resource Manager Consumption client library for Java. This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/consumption/azure-resourcemanager-consumption/README.md b/sdk/consumption/azure-resourcemanager-consumption/README.md index 4bc0fe107d50..d88d7959f2b2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/README.md +++ b/sdk/consumption/azure-resourcemanager-consumption/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-consumption - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md index a96cb65e9053..490f5950220b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md +++ b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md @@ -35,11 +35,16 @@ - [ListByBillingAccount](#lotsoperation_listbybillingaccount) - [ListByBillingProfile](#lotsoperation_listbybillingprofile) +- [ListByCustomer](#lotsoperation_listbycustomer) ## Marketplaces - [List](#marketplaces_list) +## Operations + +- [List](#operations_list) + ## PriceSheet - [Get](#pricesheet_get) @@ -768,6 +773,42 @@ public final class LotsOperationListByBillingProfileSamples { } ``` +### LotsOperation_ListByCustomer + +```java +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByCustomer. */ +public final class LotsOperationListByCustomerSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomer.json + */ + /** + * Sample code: LotsListByCustomer. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByCustomer(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByCustomer("1234:5678", "1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomerWithFilters.json + */ + /** + * Sample code: LotsListByCustomerWithFilter. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByCustomerWithFilter(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .lotsOperations() + .listByCustomer( + "1234:5678", "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + } +} +``` + ### Marketplaces_List ```java @@ -921,6 +962,27 @@ public final class MarketplacesListSamples { } ``` +### Operations_List + +```java +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/OperationList.json + */ + /** + * Sample code: PriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + ### PriceSheet_Get ```java @@ -980,6 +1042,7 @@ public final class PriceSheetGetByBillingPeriodSamples { ```java import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; /** Samples for ReservationRecommendationDetails Get. */ @@ -996,7 +1059,14 @@ public final class ReservationRecommendationDetailsGetSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-00000000", + Scope.SINGLE, + "westus", + Term.P3Y, + LookBackPeriod.LAST30DAYS, + "Standard_DS13_v2", + Context.NONE); } /* @@ -1012,7 +1082,13 @@ public final class ReservationRecommendationDetailsGetSamples { manager .reservationRecommendationDetails() .getWithResponse( - "Shared", "australiaeast", Term.P1Y, LookBackPeriod.LAST7DAYS, "Standard_B2s", Context.NONE); + "providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-00000000:00000000-0000-0000-0000-00000000/billingProfiles/00000000-0000-0000-0000-00000000", + Scope.SHARED, + "australiaeast", + Term.P1Y, + LookBackPeriod.LAST7DAYS, + "Standard_B2s", + Context.NONE); } /* @@ -1027,7 +1103,14 @@ public final class ReservationRecommendationDetailsGetSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup", + Scope.SINGLE, + "westus", + Term.P3Y, + LookBackPeriod.LAST30DAYS, + "Standard_DS13_v2", + Context.NONE); } /* @@ -1042,7 +1125,14 @@ public final class ReservationRecommendationDetailsGetSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + .getWithResponse( + "providers/Microsoft.Billing/billingAccounts/000000", + Scope.SHARED, + "eastus", + Term.P1Y, + LookBackPeriod.LAST60DAYS, + "Standard_DS14_v2", + Context.NONE); } } ``` diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java index fba287434277..8812df1bfd84 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 @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -130,6 +132,19 @@ public static ConsumptionManager authenticate(TokenCredential credential, AzureP return configure().authenticate(credential, profile); } + /** + * Creates an instance of Consumption service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the Consumption service API instance. + */ + public static ConsumptionManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new ConsumptionManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create ConsumptionManager with optional configuration. * @@ -141,13 +156,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -208,6 +224,19 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { return this; } + /** + * Sets the retry options for the HTTP pipeline retry policy. + * + *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + * + * @param retryOptions the retry options for the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryOptions(RetryOptions retryOptions) { + this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); + return this; + } + /** * Sets the default poll interval, used when service does not provide "Retry-After" header. * @@ -215,9 +244,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + this.defaultPollInterval = + Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { - throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + throw LOGGER + .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); } return this; } @@ -239,7 +270,7 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile .append("-") .append("com.azure.resourcemanager.consumption") .append("/") - .append("1.0.0-beta.3"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -257,10 +288,15 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); } if (retryPolicy == null) { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + if (retryOptions != null) { + retryPolicy = new RetryPolicy(retryOptions); + } else { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } } List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); policies .addAll( @@ -291,7 +327,11 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile } } - /** @return Resource collection API of UsageDetails. */ + /** + * Gets the resource collection API of UsageDetails. + * + * @return Resource collection API of UsageDetails. + */ public UsageDetails usageDetails() { if (this.usageDetails == null) { this.usageDetails = new UsageDetailsImpl(clientObject.getUsageDetails(), this); @@ -299,7 +339,11 @@ public UsageDetails usageDetails() { return usageDetails; } - /** @return Resource collection API of Marketplaces. */ + /** + * Gets the resource collection API of Marketplaces. + * + * @return Resource collection API of Marketplaces. + */ public Marketplaces marketplaces() { if (this.marketplaces == null) { this.marketplaces = new MarketplacesImpl(clientObject.getMarketplaces(), this); @@ -307,7 +351,11 @@ public Marketplaces marketplaces() { return marketplaces; } - /** @return Resource collection API of Budgets. */ + /** + * Gets the resource collection API of Budgets. It manages Budget. + * + * @return Resource collection API of Budgets. + */ public Budgets budgets() { if (this.budgets == null) { this.budgets = new BudgetsImpl(clientObject.getBudgets(), this); @@ -315,7 +363,11 @@ public Budgets budgets() { return budgets; } - /** @return Resource collection API of Tags. */ + /** + * Gets the resource collection API of Tags. + * + * @return Resource collection API of Tags. + */ public Tags tags() { if (this.tags == null) { this.tags = new TagsImpl(clientObject.getTags(), this); @@ -323,7 +375,11 @@ public Tags tags() { return tags; } - /** @return Resource collection API of Charges. */ + /** + * Gets the resource collection API of Charges. + * + * @return Resource collection API of Charges. + */ public Charges charges() { if (this.charges == null) { this.charges = new ChargesImpl(clientObject.getCharges(), this); @@ -331,7 +387,11 @@ public Charges charges() { return charges; } - /** @return Resource collection API of Balances. */ + /** + * Gets the resource collection API of Balances. + * + * @return Resource collection API of Balances. + */ public Balances balances() { if (this.balances == null) { this.balances = new BalancesImpl(clientObject.getBalances(), this); @@ -339,7 +399,11 @@ public Balances balances() { return balances; } - /** @return Resource collection API of ReservationsSummaries. */ + /** + * Gets the resource collection API of ReservationsSummaries. + * + * @return Resource collection API of ReservationsSummaries. + */ public ReservationsSummaries reservationsSummaries() { if (this.reservationsSummaries == null) { this.reservationsSummaries = new ReservationsSummariesImpl(clientObject.getReservationsSummaries(), this); @@ -347,7 +411,11 @@ public ReservationsSummaries reservationsSummaries() { return reservationsSummaries; } - /** @return Resource collection API of ReservationsDetails. */ + /** + * Gets the resource collection API of ReservationsDetails. + * + * @return Resource collection API of ReservationsDetails. + */ public ReservationsDetails reservationsDetails() { if (this.reservationsDetails == null) { this.reservationsDetails = new ReservationsDetailsImpl(clientObject.getReservationsDetails(), this); @@ -355,7 +423,11 @@ public ReservationsDetails reservationsDetails() { return reservationsDetails; } - /** @return Resource collection API of ReservationRecommendations. */ + /** + * Gets the resource collection API of ReservationRecommendations. + * + * @return Resource collection API of ReservationRecommendations. + */ public ReservationRecommendations reservationRecommendations() { if (this.reservationRecommendations == null) { this.reservationRecommendations = @@ -364,7 +436,11 @@ public ReservationRecommendations reservationRecommendations() { return reservationRecommendations; } - /** @return Resource collection API of ReservationRecommendationDetails. */ + /** + * Gets the resource collection API of ReservationRecommendationDetails. + * + * @return Resource collection API of ReservationRecommendationDetails. + */ public ReservationRecommendationDetails reservationRecommendationDetails() { if (this.reservationRecommendationDetails == null) { this.reservationRecommendationDetails = @@ -373,7 +449,11 @@ public ReservationRecommendationDetails reservationRecommendationDetails() { return reservationRecommendationDetails; } - /** @return Resource collection API of ReservationTransactions. */ + /** + * Gets the resource collection API of ReservationTransactions. + * + * @return Resource collection API of ReservationTransactions. + */ public ReservationTransactions reservationTransactions() { if (this.reservationTransactions == null) { this.reservationTransactions = @@ -382,7 +462,11 @@ public ReservationTransactions reservationTransactions() { return reservationTransactions; } - /** @return Resource collection API of PriceSheets. */ + /** + * Gets the resource collection API of PriceSheets. + * + * @return Resource collection API of PriceSheets. + */ public PriceSheets priceSheets() { if (this.priceSheets == null) { this.priceSheets = new PriceSheetsImpl(clientObject.getPriceSheets(), this); @@ -390,7 +474,11 @@ public PriceSheets priceSheets() { return priceSheets; } - /** @return Resource collection API of Operations. */ + /** + * Gets the resource collection API of Operations. + * + * @return Resource collection API of Operations. + */ public Operations operations() { if (this.operations == null) { this.operations = new OperationsImpl(clientObject.getOperations(), this); @@ -398,7 +486,11 @@ public Operations operations() { return operations; } - /** @return Resource collection API of AggregatedCosts. */ + /** + * Gets the resource collection API of AggregatedCosts. + * + * @return Resource collection API of AggregatedCosts. + */ public AggregatedCosts aggregatedCosts() { if (this.aggregatedCosts == null) { this.aggregatedCosts = new AggregatedCostsImpl(clientObject.getAggregatedCosts(), this); @@ -406,7 +498,11 @@ public AggregatedCosts aggregatedCosts() { return aggregatedCosts; } - /** @return Resource collection API of EventsOperations. */ + /** + * Gets the resource collection API of EventsOperations. + * + * @return Resource collection API of EventsOperations. + */ public EventsOperations eventsOperations() { if (this.eventsOperations == null) { this.eventsOperations = new EventsOperationsImpl(clientObject.getEventsOperations(), this); @@ -414,7 +510,11 @@ public EventsOperations eventsOperations() { return eventsOperations; } - /** @return Resource collection API of LotsOperations. */ + /** + * Gets the resource collection API of LotsOperations. + * + * @return Resource collection API of LotsOperations. + */ public LotsOperations lotsOperations() { if (this.lotsOperations == null) { this.lotsOperations = new LotsOperationsImpl(clientObject.getLotsOperations(), this); @@ -422,7 +522,11 @@ public LotsOperations lotsOperations() { return lotsOperations; } - /** @return Resource collection API of Credits. */ + /** + * Gets the resource collection API of Credits. + * + * @return Resource collection API of Credits. + */ public Credits credits() { if (this.credits == null) { this.credits = new CreditsImpl(clientObject.getCredits(), this); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java index 813767044909..5226b38b9591 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java @@ -35,7 +35,7 @@ public interface AggregatedCostsClient { * @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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByManagementGroupWithResponse( @@ -64,7 +64,7 @@ ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup( * @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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getForBillingPeriodByManagementGroupWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BalancesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BalancesClient.java index e21a93426a85..7753615b49e7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BalancesClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BalancesClient.java @@ -34,7 +34,7 @@ public interface BalancesClient { * @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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByBillingAccountWithResponse(String billingAccountId, Context context); @@ -63,7 +63,7 @@ public interface BalancesClient { * @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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getForBillingPeriodByBillingAccountWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BudgetsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BudgetsClient.java index 031ef9c557ca..7a254e4bebde 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BudgetsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/BudgetsClient.java @@ -31,7 +31,7 @@ public interface BudgetsClient { * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -55,7 +55,7 @@ public interface BudgetsClient { * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); @@ -104,7 +104,7 @@ public interface BudgetsClient { * @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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String scope, String budgetName, Context context); @@ -159,7 +159,7 @@ public interface BudgetsClient { * @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 budget resource. + * @return a budget resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response createOrUpdateWithResponse( @@ -208,7 +208,7 @@ Response createOrUpdateWithResponse( * @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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response deleteWithResponse(String scope, String budgetName, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ChargesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ChargesClient.java index 58df00d67d60..c6f0fb6b9be3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ChargesClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ChargesClient.java @@ -70,7 +70,7 @@ public interface ChargesClient { * @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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response listWithResponse( 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 4a9bba8b64c6..2cd5ce5a6372 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 @@ -34,7 +34,7 @@ public interface CreditsClient { * @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. + * @return a credit summary resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) 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 7591c8b7840b..b9c7f11a7a63 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 @@ -23,7 +23,7 @@ public interface EventsOperationsClient { * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingProfile( @@ -41,7 +41,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingProfile( @@ -55,7 +55,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingAccount(String billingAccountId); @@ -72,7 +72,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @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 6c7db7249652..43d2f2092bcd 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,22 +13,22 @@ /** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ public interface LotsOperationsClient { /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingProfile(String billingAccountId, String 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. @@ -36,28 +36,28 @@ public interface LotsOperationsClient { * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -67,8 +67,40 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer(String billingAccountId, String customerId); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer( + String billingAccountId, String customerId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java index 56f5b91e7340..a6a9d0d63389 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java @@ -28,7 +28,7 @@ public interface MarketplacesClient { * @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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -57,7 +57,7 @@ public interface MarketplacesClient { * @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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, String filter, Integer top, String skiptoken, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java index d8528c9abbd3..2572135f1224 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java @@ -17,7 +17,7 @@ public interface OperationsClient { * * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -29,7 +29,7 @@ public interface OperationsClient { * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(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 083b16f7e65c..d10e419cb7cd 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 @@ -35,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 subscription. + * @return the price sheet for a subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String expand, String skiptoken, Integer top, Context context); @@ -68,7 +68,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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getByBillingPeriodWithResponse( 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 042ad2b40fdd..6e41923b3f90 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java @@ -10,6 +10,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner; import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; /** @@ -19,12 +20,13 @@ public interface ReservationRecommendationDetailsClient { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -37,17 +39,18 @@ public interface ReservationRecommendationDetailsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) ReservationRecommendationDetailsModelInner get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -57,9 +60,15 @@ ReservationRecommendationDetailsModelInner get( * @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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationsClient.java index c713f5d4d277..2cdb16d222ea 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationsClient.java @@ -15,7 +15,7 @@ public interface ReservationRecommendationsClient { /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -24,15 +24,15 @@ public interface ReservationRecommendationsClient { * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -48,8 +48,8 @@ public interface ReservationRecommendationsClient { * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, String filter, Context context); + PagedIterable list(String resourceScope, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java index 3d45b967b6e3..8f3b75434ff4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java @@ -14,58 +14,75 @@ /** An instance of this class provides access to all the operations defined in ReservationTransactionsClient. */ public interface ReservationTransactionsClient { /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String billingAccountId); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String billingAccountId, String filter, Context context); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingProfile( String billingAccountId, String billingProfileId); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingProfile( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsDetailsClient.java index 2ffbf884bf39..5fdf582b62a9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsDetailsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsDetailsClient.java @@ -21,7 +21,7 @@ public interface ReservationsDetailsClient { * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrder(String reservationOrderId, String filter); @@ -36,7 +36,7 @@ public interface ReservationsDetailsClient { * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrder( @@ -52,7 +52,7 @@ PagedIterable listByReservationOrder( * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrderAndReservation( @@ -69,7 +69,7 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrderAndReservation( @@ -78,22 +78,22 @@ PagedIterable listByReservationOrderAndReservation( /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -109,11 +109,11 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String scope, + String resourceScope, String startDate, String endDate, String filter, 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 40be069d1339..f69a1b7eba39 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 @@ -21,7 +21,7 @@ public interface ReservationsSummariesClient { * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain); @@ -37,7 +37,7 @@ public interface ReservationsSummariesClient { * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrder( @@ -52,7 +52,7 @@ PagedIterable listByReservationOrder( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrderAndReservation( @@ -70,7 +70,7 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByReservationOrderAndReservation( @@ -79,7 +79,7 @@ PagedIterable listByReservationOrderAndReservation( /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -87,15 +87,15 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope, Datagrain grain); + PagedIterable list(String resourceScope, Datagrain grain); /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -112,11 +112,11 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java index 2266b2caca8c..51513f3ef75c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java @@ -46,7 +46,7 @@ public interface TagsClient { * @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 all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getWithResponse(String scope, Context context); 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 e89c21afee28..58aad7b4521b 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 @@ -37,7 +37,7 @@ public interface UsageDetailsClient { * @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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -79,7 +79,7 @@ public interface UsageDetailsClient { * @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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( 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 be4d23435c3b..88cb54ce4cd7 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 @@ -6,11 +6,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem; import com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem; import com.azure.resourcemanager.consumption.models.BillingFrequency; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -20,8 +18,6 @@ /** A balance resource. */ @Fluent public final class BalanceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalanceInner.class); - /* * The properties of the balance. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java index f0e15ad53cf2..26cc57ff30dc 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java @@ -5,11 +5,9 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem; import com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem; import com.azure.resourcemanager.consumption.models.BillingFrequency; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.List; @@ -17,8 +15,6 @@ /** The properties of the balance. */ @Fluent public final class BalanceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalanceProperties.class); - /* * The ISO currency in which the meter is charged, for example, USD. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java index f8fea1a4e18b..f188de9f3491 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BudgetFilter; import com.azure.resourcemanager.consumption.models.BudgetTimePeriod; import com.azure.resourcemanager.consumption.models.CategoryType; @@ -14,7 +13,6 @@ import com.azure.resourcemanager.consumption.models.ForecastSpend; import com.azure.resourcemanager.consumption.models.Notification; import com.azure.resourcemanager.consumption.models.TimeGrainType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.Map; @@ -22,8 +20,6 @@ /** A budget resource. */ @Fluent public final class BudgetInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetInner.class); - /* * The properties of the budget. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java index ef8131acd287..1f2fb2ffbb64 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java @@ -13,7 +13,6 @@ import com.azure.resourcemanager.consumption.models.ForecastSpend; import com.azure.resourcemanager.consumption.models.Notification; import com.azure.resourcemanager.consumption.models.TimeGrainType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -22,8 +21,6 @@ /** The properties of the budget. */ @Fluent public final class BudgetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetProperties.class); - /* * The category of the budget, whether the budget tracks cost or usage. */ @@ -235,22 +232,22 @@ public ForecastSpend forecastSpend() { */ public void validate() { if (category() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property category in model BudgetProperties")); } if (amount() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property amount in model BudgetProperties")); } if (timeGrain() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property timeGrain in model BudgetProperties")); } if (timePeriod() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property timePeriod in model BudgetProperties")); } else { @@ -276,4 +273,6 @@ public void validate() { forecastSpend().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetProperties.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java index 4675dd79f2cb..c7810d6a49a1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ChargeSummary; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing charge summary. */ @Immutable public final class ChargesListResultInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargesListResultInner.class); - /* * The list of charge summary */ 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 0ee648db2f11..599f99fa2c01 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 @@ -6,11 +6,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,8 +16,6 @@ /** A credit summary resource. */ @Fluent public final class CreditSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryInner.class); - /* * The properties of the credit summary. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java index cbe557ebe2bb..0aa81ffb166c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of the credit summary. */ @Immutable public final class CreditSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryProperties.class); - /* * Summary of balances associated with this credit summary. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java index c431a1c9e2bf..ed783313da78 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java @@ -5,20 +5,16 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.EventType; import com.azure.resourcemanager.consumption.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The event properties. */ @Fluent public final class EventProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventProperties.class); - /* * The date of the event. */ 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 e031fc2d183d..5366be0f6da5 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 @@ -6,20 +6,16 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.EventType; import com.azure.resourcemanager.consumption.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** An event summary resource. */ @Fluent public final class EventSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSummaryInner.class); - /* * The event properties. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java index 935660710f20..090c8198dd08 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The properties of legacy charge summary. */ @Immutable public final class LegacyChargeSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummaryProperties.class); - /* * The id of the billing period resource that the charge belongs to. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java index 521171b6a9d1..d8b8a401f687 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java @@ -5,11 +5,9 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.LegacySharedScopeReservationRecommendationProperties; import com.azure.resourcemanager.consumption.models.LegacySingleScopeReservationRecommendationProperties; import com.azure.resourcemanager.consumption.models.SkuProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -32,8 +30,6 @@ }) @Immutable public class LegacyReservationRecommendationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendationProperties.class); - /* * The number of days of usage to look back for recommendation. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java index 55ddcf621918..72f3b82ec03c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -15,8 +13,6 @@ /** The properties of a legacy reservation transaction. */ @Immutable public final class LegacyReservationTransactionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationTransactionProperties.class); - /* * The date of the transaction */ @@ -39,7 +35,7 @@ public final class LegacyReservationTransactionProperties { private String description; /* - * The type of the transaction (Purchase, Cancel, etc.) + * The type of the transaction (Purchase, Cancel or Refund). */ @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) private String eventType; @@ -190,7 +186,7 @@ public String description() { } /** - * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Get the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java index 39b1dfa8f812..561d24cd39df 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java @@ -5,10 +5,8 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.MeterDetailsResponse; import com.azure.resourcemanager.consumption.models.PricingModelType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -17,8 +15,6 @@ /** The properties of the legacy usage detail. */ @Immutable public final class LegacyUsageDetailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetailProperties.class); - /* * Billing Account identifier. */ @@ -297,6 +293,18 @@ public final class LegacyUsageDetailProperties { @JsonProperty(value = "payGPrice", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal payGPrice; + /* + * Unique identifier for the applicable benefit. + */ + @JsonProperty(value = "benefitId", access = JsonProperty.Access.WRITE_ONLY) + private String benefitId; + + /* + * Name of the applicable benefit. + */ + @JsonProperty(value = "benefitName", access = JsonProperty.Access.WRITE_ONLY) + private String benefitName; + /* * Identifier that indicates how the meter is priced. */ @@ -704,6 +712,24 @@ public BigDecimal payGPrice() { return this.payGPrice; } + /** + * Get the benefitId property: Unique identifier for the applicable benefit. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.benefitId; + } + + /** + * Get the benefitName property: Name of the applicable benefit. + * + * @return the benefitName value. + */ + public String benefitName() { + return this.benefitName; + } + /** * Get the pricingModel property: Identifier that indicates how the meter is priced. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java index 6849ba86cdac..ce61a5d1dff2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java @@ -5,21 +5,17 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.Reseller; import com.azure.resourcemanager.consumption.models.Status; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The lot properties. */ @Immutable public final class LotProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LotProperties.class); - /* * The original amount of a lot. */ 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 66ba7de656ca..84d8fddae286 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 @@ -6,21 +6,17 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.Reseller; import com.azure.resourcemanager.consumption.models.Status; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** A lot summary resource. */ @Fluent public final class LotSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LotSummaryInner.class); - /* * The lot properties. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java index de916d475acc..5b259589cee0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -15,8 +13,6 @@ /** The properties of the Management Group Aggregated Cost. */ @Fluent public final class ManagementGroupAggregatedCostProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupAggregatedCostProperties.class); - /* * The id of the billing period resource that the aggregated cost belongs * to. 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 dfe72201c6f3..534400330068 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 @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -18,8 +16,6 @@ /** A management group aggregated cost resource. */ @Fluent public final class ManagementGroupAggregatedCostResultInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagementGroupAggregatedCostResultInner.class); - /* * The properties of the Management Group Aggregated Cost. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java index 659cbacda58b..6e0942905ab2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -18,8 +16,6 @@ /** A marketplace resource. */ @Fluent public final class MarketplaceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceInner.class); - /* * The properties of the marketplace usage detail. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java index 006420b0220a..d4cf08510b0f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -15,8 +13,6 @@ /** The properties of the marketplace usage detail. */ @Immutable public final class MarketplaceProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceProperties.class); - /* * The id of the billing period resource that the usage belongs to. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java index 9a5a2f9e026a..aaa060990b24 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of modern charge summary. */ @Immutable public final class ModernChargeSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummaryProperties.class); - /* * The id of the billing period resource that the charge belongs to. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java index 00df5480536b..d5a7b17bd53d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java @@ -5,10 +5,8 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.SkuProperty; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -18,8 +16,6 @@ /** The properties of the reservation recommendation. */ @Immutable public final class ModernReservationRecommendationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendationProperties.class); - /* * Resource Location. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java index 636c1f94bcf5..b048492d74d6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationTransactionResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -16,8 +15,6 @@ /** Modern Reservation transaction resource. */ @Fluent public final class ModernReservationTransactionInner extends ReservationTransactionResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionInner.class); - /* * The properties of a modern reservation transaction. */ @@ -107,7 +104,7 @@ public OffsetDateTime eventDate() { } /** - * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Get the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ @@ -225,7 +222,7 @@ public String term() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model ModernReservationTransactionInner")); @@ -233,4 +230,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernReservationTransactionInner.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java index fb749b85a558..93bfb358cd85 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -15,8 +13,6 @@ /** The properties of a modern reservation transaction. */ @Immutable public final class ModernReservationTransactionProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionProperties.class); - /* * The charge of the transaction. */ @@ -67,7 +63,7 @@ public final class ModernReservationTransactionProperties { private OffsetDateTime eventDate; /* - * The type of the transaction (Purchase, Cancel, etc.) + * The type of the transaction (Purchase, Cancel or Refund). */ @JsonProperty(value = "eventType", access = JsonProperty.Access.WRITE_ONLY) private String eventType; @@ -215,7 +211,7 @@ public OffsetDateTime eventDate() { } /** - * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Get the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java index 00c64480a2cd..9ccb804dccb5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.PricingModelType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -16,8 +14,6 @@ /** The properties of the usage detail. */ @Immutable public final class ModernUsageDetailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetailProperties.class); - /* * Billing Account identifier. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java index fe76c6fdfa54..f8fadb1f48ae 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** A Consumption REST API operation. */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation Id. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java index 0e4aa629a411..2b2b7ec03fac 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.MeterDetails; import com.azure.resourcemanager.consumption.models.PriceSheetProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** price sheet result. It contains the pricesheet associated with billing period. */ @Immutable public final class PriceSheetModel { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetModel.class); - /* * Price sheet */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java index 7d19b3f74d32..fd426e25c823 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java @@ -6,10 +6,8 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.MeterDetails; import com.azure.resourcemanager.consumption.models.PriceSheetProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -18,8 +16,6 @@ /** An pricesheet resource. */ @Fluent public final class PriceSheetResultInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetResultInner.class); - /* * price sheet result. It contains the pricesheet associated with billing * period diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java index ba58947769d8..49054439d9f7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -17,8 +15,6 @@ /** reservation detail resource. */ @Fluent public final class ReservationDetailInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailInner.class); - /* * The properties of the reservation detail. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java index 99fe617af2d0..a4f42842afd9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -14,8 +12,6 @@ /** The properties of the reservation detail. */ @Immutable public final class ReservationDetailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailProperties.class); - /* * The reservation order ID is the identifier for a reservation purchase. * Each reservation order ID represents a single purchase transaction. A diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java index 68e957a682f6..c652c582d9c0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java @@ -6,11 +6,9 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsResourceProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsSavingsProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsUsageProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; @@ -18,8 +16,6 @@ /** Reservation recommendation details. */ @Fluent public final class ReservationRecommendationDetailsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsModelInner.class); - /* * Resource Location. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java index adeb2dae589c..7eb421ae6eaa 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java @@ -5,18 +5,14 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsResourceProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsSavingsProperties; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsUsageProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of the reservation recommendation. */ @Immutable public final class ReservationRecommendationDetailsProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsProperties.class); - /* * An ISO 4217 currency code identifier for the costs and savings */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java index 45566e5e4012..279fbf43e982 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java @@ -6,10 +6,8 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.LegacyReservationRecommendation; import com.azure.resourcemanager.consumption.models.ModernReservationRecommendation; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -30,8 +28,6 @@ }) @Immutable public class ReservationRecommendationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationInner.class); - /* * The etag for the resource. */ 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 7b913e6e0ac3..7c7b6e9339df 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 @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -17,8 +15,6 @@ /** reservation summary resource. */ @Fluent public final class ReservationSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryInner.class); - /* * The properties of the reservation summary. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java index 2bd838de647e..cc94045dbe4f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -14,8 +12,6 @@ /** The properties of the reservation summary. */ @Immutable public final class ReservationSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryProperties.class); - /* * The reservation order ID is the identifier for a reservation purchase. * Each reservation order ID represents a single purchase transaction. A diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java index f09a430c58bf..6b73f7540d18 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.ReservationTransactionResource; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; @@ -16,8 +14,6 @@ /** Reservation transaction resource. */ @Fluent public class ReservationTransactionInner extends ReservationTransactionResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionInner.class); - /* * The properties of a legacy reservation transaction. */ @@ -63,7 +59,7 @@ public String description() { } /** - * Get the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Get the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java index c38afadca36c..445cc9f94d6c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Tag; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The properties of the tag. */ @Fluent public final class TagProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagProperties.class); - /* * A list of Tag. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java index 2cd3f869d8e8..b7b9e0234e6d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java @@ -6,17 +6,13 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Tag; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** A resource listing all tags. */ @Fluent public final class TagsResultInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsResultInner.class); - /* * The properties of the tag. */ 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 97647be02c10..80a9fc31484a 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 @@ -6,10 +6,8 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.LegacyUsageDetail; import com.azure.resourcemanager.consumption.models.ModernUsageDetail; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; @@ -30,8 +28,6 @@ }) @Immutable public class UsageDetailInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailInner.class); - /* * The etag for the resource. */ 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 c241892a5f74..86252a896c06 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 @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.AggregatedCostsClient; import com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in AggregatedCostsClient. */ public final class AggregatedCostsClientImpl implements AggregatedCostsClient { - private final ClientLogger logger = new ClientLogger(AggregatedCostsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final AggregatedCostsService service; @@ -93,7 +90,8 @@ Mono> getForBillingPeriodByMa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByManagementGroupWithResponseAsync( @@ -134,7 +132,8 @@ private Mono> getByManagement * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByManagementGroupWithResponseAsync( @@ -166,20 +165,13 @@ private Mono> getByManagement * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByManagementGroupAsync( String managementGroupId, String filter) { return getByManagementGroupWithResponseAsync(managementGroupId, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -189,20 +181,13 @@ private Mono getByManagementGroupAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByManagementGroupAsync(String managementGroupId) { final String filter = null; return getByManagementGroupWithResponseAsync(managementGroupId, filter) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -231,7 +216,7 @@ public ManagementGroupAggregatedCostResultInner getByManagementGroup(String mana * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByManagementGroupWithResponse( @@ -247,7 +232,8 @@ public Response getByManagementGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -290,7 +276,8 @@ public Response getByManagementGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> @@ -330,20 +317,13 @@ public Response getByManagementGroupWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getForBillingPeriodByManagementGroupAsync( String managementGroupId, String billingPeriodName) { return getForBillingPeriodByManagementGroupWithResponseAsync(managementGroupId, billingPeriodName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -371,7 +351,7 @@ public ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getForBillingPeriodByManagementGroupWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsImpl.java index 946543806553..6f17012a44fb 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner; import com.azure.resourcemanager.consumption.models.AggregatedCosts; import com.azure.resourcemanager.consumption.models.ManagementGroupAggregatedCostResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class AggregatedCostsImpl implements AggregatedCosts { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AggregatedCostsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(AggregatedCostsImpl.class); private final AggregatedCostsClient innerClient; 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..78a5f500e843 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 @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.BalancesClient; import com.azure.resourcemanager.consumption.fluent.models.BalanceInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in BalancesClient. */ public final class BalancesClientImpl implements BalancesClient { - private final ClientLogger logger = new ClientLogger(BalancesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BalancesService service; @@ -87,7 +84,8 @@ Mono> getForBillingPeriodByBillingAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByBillingAccountWithResponseAsync(String billingAccountId) { @@ -120,7 +118,8 @@ private Mono> getByBillingAccountWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByBillingAccountWithResponseAsync( @@ -150,19 +149,11 @@ private Mono> getByBillingAccountWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByBillingAccountAsync(String billingAccountId) { - return getByBillingAccountWithResponseAsync(billingAccountId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getByBillingAccountWithResponseAsync(billingAccountId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -189,7 +180,7 @@ public BalanceInner getByBillingAccount(String billingAccountId) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { @@ -205,7 +196,8 @@ public Response getByBillingAccountWithResponse(String billingAcco * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getForBillingPeriodByBillingAccountWithResponseAsync( @@ -249,7 +241,8 @@ private Mono> getForBillingPeriodByBillingAccountWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getForBillingPeriodByBillingAccountWithResponseAsync( @@ -289,20 +282,13 @@ private Mono> getForBillingPeriodByBillingAccountWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getForBillingPeriodByBillingAccountAsync( String billingAccountId, String billingPeriodName) { return getForBillingPeriodByBillingAccountWithResponseAsync(billingAccountId, billingPeriodName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -331,7 +317,7 @@ public BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getForBillingPeriodByBillingAccountWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesImpl.java index e1652cddc7ca..ba694a455d1a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalancesImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.BalanceInner; import com.azure.resourcemanager.consumption.models.Balance; import com.azure.resourcemanager.consumption.models.Balances; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BalancesImpl implements Balances { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalancesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BalancesImpl.class); private final BalancesClient innerClient; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java index d1175bb8bab1..0f798b884954 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java @@ -28,7 +28,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.BudgetsClient; import com.azure.resourcemanager.consumption.fluent.models.BudgetInner; import com.azure.resourcemanager.consumption.models.BudgetsListResult; @@ -36,8 +35,6 @@ /** An instance of this class provides access to all the operations defined in BudgetsClient. */ public final class BudgetsClientImpl implements BudgetsClient { - private final ClientLogger logger = new ClientLogger(BudgetsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final BudgetsService service; @@ -138,7 +135,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope) { @@ -186,7 +183,7 @@ private Mono> listSinglePageAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope, Context context) { @@ -232,7 +229,7 @@ private Mono> listSinglePageAsync(String scope, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -258,7 +255,7 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { @@ -284,7 +281,7 @@ private PagedFlux listAsync(String scope, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -310,7 +307,7 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope, Context context) { @@ -336,7 +333,8 @@ public PagedIterable list(String scope, Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope, String budgetName) { @@ -382,7 +380,8 @@ private Mono> getWithResponseAsync(String scope, String bu * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope, String budgetName, Context context) { @@ -422,19 +421,11 @@ private Mono> getWithResponseAsync(String scope, String bu * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget for the scope by budget name. + * @return the budget for the scope by budget name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String scope, String budgetName) { - return getWithResponseAsync(scope, budgetName) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(scope, budgetName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -483,7 +474,7 @@ public BudgetInner get(String scope, String budgetName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String scope, String budgetName, Context context) { @@ -512,7 +503,7 @@ public Response getWithResponse(String scope, String budgetName, Co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget resource. + * @return a budget resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -573,7 +564,7 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget resource. + * @return a budget resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -624,19 +615,12 @@ private Mono> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget resource. + * @return a budget resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String scope, String budgetName, BudgetInner parameters) { return createOrUpdateWithResponseAsync(scope, budgetName, parameters) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -691,7 +675,7 @@ public BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner p * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budget resource. + * @return a budget resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse( @@ -718,7 +702,7 @@ public Response createOrUpdateWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String scope, String budgetName) { @@ -764,7 +748,7 @@ private Mono> deleteWithResponseAsync(String scope, String budget * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String scope, String budgetName, Context context) { @@ -805,11 +789,11 @@ private Mono> deleteWithResponseAsync(String scope, String budget * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 completion. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono deleteAsync(String scope, String budgetName) { - return deleteWithResponseAsync(scope, budgetName).flatMap((Response res) -> Mono.empty()); + return deleteWithResponseAsync(scope, budgetName).flatMap(ignored -> Mono.empty()); } /** @@ -857,7 +841,7 @@ public void delete(String scope, String budgetName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 response. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String scope, String budgetName, Context context) { @@ -871,7 +855,7 @@ public Response deleteWithResponse(String scope, String budgetName, Contex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -907,7 +891,7 @@ private Mono> listNextSinglePageAsync(String nextLink * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 budgets. + * @return result of listing budgets along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java index 533b9307c644..56ed1274fc25 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.consumption.fluent.models.BudgetInner; import com.azure.resourcemanager.consumption.models.Budget; import com.azure.resourcemanager.consumption.models.Budgets; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class BudgetsImpl implements Budgets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(BudgetsImpl.class); private final BudgetsClient innerClient; @@ -74,7 +73,7 @@ public Budget getById(String id) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); @@ -84,7 +83,7 @@ public Budget getById(String id) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); @@ -98,7 +97,7 @@ public Response getByIdWithResponse(String id, Context context) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); @@ -108,7 +107,7 @@ public Response getByIdWithResponse(String id, Context context) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); @@ -122,7 +121,7 @@ public void deleteById(String id) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); @@ -132,7 +131,7 @@ public void deleteById(String id) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); @@ -146,7 +145,7 @@ public Response deleteByIdWithResponse(String id, Context context) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); @@ -156,7 +155,7 @@ public Response deleteByIdWithResponse(String id, Context context) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesClientImpl.java index 7a1bc33418ff..09d3dbab8d19 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesClientImpl.java @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ChargesClient; import com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in ChargesClient. */ public final class ChargesClientImpl implements ChargesClient { - private final ClientLogger logger = new ClientLogger(ChargesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ChargesService service; @@ -99,7 +96,7 @@ Mono> list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 charge summary. + * @return result of listing charge summary along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -162,7 +159,7 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 charge summary. + * @return result of listing charge summary along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listWithResponseAsync( @@ -221,20 +218,13 @@ private Mono> listWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 charge summary. + * @return result of listing charge summary on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync( String scope, String startDate, String endDate, String filter, String apply) { return listWithResponseAsync(scope, startDate, endDate, filter, apply) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -259,7 +249,7 @@ private Mono listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 charge summary. + * @return result of listing charge summary on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String scope) { @@ -268,14 +258,7 @@ private Mono listAsync(String scope) { final String filter = null; final String apply = null; return listWithResponseAsync(scope, startDate, endDate, filter, apply) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -342,7 +325,7 @@ public ChargesListResultInner list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response listWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesImpl.java index f698da520154..206ac4ed3ee8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner; import com.azure.resourcemanager.consumption.models.Charges; import com.azure.resourcemanager.consumption.models.ChargesListResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ChargesImpl implements Charges { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ChargesImpl.class); private final ChargesClient innerClient; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java index efd5a406aff6..aa84fc278f85 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.ServiceClientBuilder; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.CookiePolicy; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.AzureEnvironment; @@ -67,34 +66,34 @@ public ConsumptionManagementClientBuilder environment(AzureEnvironment environme } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the ConsumptionManagementClientBuilder. */ - public ConsumptionManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public ConsumptionManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the ConsumptionManagementClientBuilder. */ - public ConsumptionManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public ConsumptionManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -126,15 +125,12 @@ public ConsumptionManagementClientImpl buildClient() { if (environment == null) { this.environment = AzureEnvironment.AZURE; } + if (pipeline == null) { + this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + } if (defaultPollInterval == null) { this.defaultPollInterval = Duration.ofSeconds(30); } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } if (serializerAdapter == null) { this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); } 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 d4a20bf01a4c..e517d0ce321e 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 @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -45,15 +46,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the ConsumptionManagementClientImpl type. */ @ServiceClient(builder = ConsumptionManagementClientBuilder.class) public final class ConsumptionManagementClientImpl implements ConsumptionManagementClient { - private final ClientLogger logger = new ClientLogger(ConsumptionManagementClientImpl.class); - /** Azure Subscription ID. */ private final String subscriptionId; @@ -388,10 +386,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -455,7 +450,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -514,4 +509,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(ConsumptionManagementClientImpl.class); } 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 0167b867175e..a0bc2e3a8da0 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 @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.CreditsClient; import com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in CreditsClient. */ public final class CreditsClientImpl implements CreditsClient { - private final ClientLogger logger = new ClientLogger(CreditsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final CreditsService service; @@ -76,7 +73,7 @@ Mono> 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 a credit summary resource. + * @return a credit summary resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String billingAccountId, String billingProfileId) { @@ -118,7 +115,7 @@ private Mono> getWithResponseAsync(String billingAc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a credit summary resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -157,19 +154,12 @@ 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 a credit summary resource. + * @return a credit summary resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String billingAccountId, String billingProfileId) { return getWithResponseAsync(billingAccountId, billingProfileId) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -196,7 +186,7 @@ public CreditSummaryInner get(String billingAccountId, String billingProfileId) * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return a credit summary resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( 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 0a36ba8d42d2..7b0152353109 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 @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner; import com.azure.resourcemanager.consumption.models.CreditSummary; import com.azure.resourcemanager.consumption.models.Credits; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class CreditsImpl implements Credits { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(CreditsImpl.class); private final CreditsClient innerClient; 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 669bd221ad8d..c15adaa11ce4 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.EventsOperationsClient; import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; import com.azure.resourcemanager.consumption.models.Events; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ public final class EventsOperationsClientImpl implements EventsOperationsClient { - private final ClientLogger logger = new ClientLogger(EventsOperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final EventsOperationsService service; @@ -119,7 +116,8 @@ Mono> listByBillingAccountNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -182,7 +180,8 @@ private Mono> listByBillingProfileSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -241,7 +240,7 @@ private Mono> listByBillingProfileSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -263,7 +262,7 @@ private PagedFlux listByBillingProfileAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -284,7 +283,7 @@ private PagedFlux listByBillingProfileAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile( @@ -304,7 +303,7 @@ public PagedIterable listByBillingProfile( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile( @@ -324,7 +323,8 @@ public PagedIterable listByBillingProfile( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountSinglePageAsync( @@ -375,7 +375,8 @@ private Mono> listByBillingAccountSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountSinglePageAsync( @@ -417,7 +418,7 @@ private Mono> listByBillingAccountSinglePageAsy * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { @@ -434,7 +435,7 @@ private PagedFlux listByBillingAccountAsync(String billingAcc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId) { @@ -456,7 +457,7 @@ private PagedFlux listByBillingAccountAsync(String billingAcc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync( @@ -474,7 +475,7 @@ private PagedFlux listByBillingAccountAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccount(String billingAccountId) { @@ -494,7 +495,7 @@ public PagedIterable listByBillingAccount(String billingAccou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccount( @@ -509,7 +510,8 @@ public PagedIterable listByBillingAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { @@ -546,7 +548,8 @@ private Mono> listByBillingProfileNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync( @@ -582,7 +585,8 @@ private Mono> listByBillingProfileNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { @@ -619,7 +623,8 @@ private Mono> listByBillingAccountNextSinglePag * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountNextSinglePageAsync( 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 4e5f0b2bd8f4..51c88eed0f57 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 @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; import com.azure.resourcemanager.consumption.models.EventSummary; import com.azure.resourcemanager.consumption.models.EventsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class EventsOperationsImpl implements EventsOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventsOperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(EventsOperationsImpl.class); private final EventsOperationsClient innerClient; 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 e17ef7138dbc..2072fcfcd5ee 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.LotsOperationsClient; import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; import com.azure.resourcemanager.consumption.models.Lots; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ public final class LotsOperationsClientImpl implements LotsOperationsClient { - private final ClientLogger logger = new ClientLogger(LotsOperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final LotsOperationsService service; @@ -85,6 +82,21 @@ Mono> listByBillingAccount( @HeaderParam("Accept") String accept, Context context); + @Headers({"Content-Type: application/json"}) + @Get( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}/providers" + + "/Microsoft.Consumption/lots") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCustomer( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @PathParam("customerId") String customerId, + @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, + Context context); + @Headers({"Content-Type: application/json"}) @Get("{nextLink}") @ExpectedResponses({200}) @@ -104,18 +116,28 @@ Mono> listByBillingAccountNext( @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByCustomerNext( + @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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -159,8 +181,8 @@ private Mono> listByBillingProfileSinglePageAsync } /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. @@ -168,7 +190,7 @@ private Mono> listByBillingProfileSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -209,15 +231,15 @@ private Mono> listByBillingProfileSinglePageAsync } /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId) { @@ -227,8 +249,8 @@ private PagedFlux listByBillingProfileAsync(String billingAccou } /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. @@ -236,7 +258,7 @@ private PagedFlux listByBillingProfileAsync(String billingAccou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -247,15 +269,15 @@ private PagedFlux listByBillingProfileAsync( } /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { @@ -263,8 +285,8 @@ public PagedIterable listByBillingProfile(String billingAccount } /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. @@ -272,7 +294,7 @@ public PagedIterable listByBillingProfile(String billingAccount * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile( @@ -281,8 +303,8 @@ public PagedIterable listByBillingProfile( } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -291,7 +313,7 @@ public PagedIterable listByBillingProfile( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountSinglePageAsync( @@ -331,8 +353,8 @@ private Mono> listByBillingAccountSinglePageAsync } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -342,7 +364,7 @@ private Mono> listByBillingAccountSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountSinglePageAsync( @@ -374,8 +396,8 @@ private Mono> listByBillingAccountSinglePageAsync } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -384,7 +406,7 @@ private Mono> listByBillingAccountSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { @@ -394,14 +416,14 @@ private PagedFlux listByBillingAccountAsync(String billingAccou } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId) { @@ -412,8 +434,8 @@ private PagedFlux listByBillingAccountAsync(String billingAccou } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -423,7 +445,7 @@ private PagedFlux listByBillingAccountAsync(String billingAccou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync( @@ -434,14 +456,14 @@ private PagedFlux listByBillingAccountAsync( } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccount(String billingAccountId) { @@ -450,8 +472,8 @@ public PagedIterable listByBillingAccount(String billingAccount } /** - * 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -461,7 +483,7 @@ public PagedIterable listByBillingAccount(String billingAccount * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccount( @@ -469,6 +491,210 @@ public PagedIterable listByBillingAccount( return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, filter, context)); } + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerSinglePageAsync( + String billingAccountId, String customerId, 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.")); + } + if (customerId == null) { + return Mono.error(new IllegalArgumentException("Parameter customerId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByCustomer( + this.client.getEndpoint(), + billingAccountId, + customerId, + 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 all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerSinglePageAsync( + String billingAccountId, String customerId, 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.")); + } + if (customerId == null) { + return Mono.error(new IllegalArgumentException("Parameter customerId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByCustomer( + this.client.getEndpoint(), + billingAccountId, + customerId, + this.client.getApiVersion(), + filter, + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCustomerAsync(String billingAccountId, String customerId, String filter) { + return new PagedFlux<>( + () -> listByCustomerSinglePageAsync(billingAccountId, customerId, filter), + nextLink -> listByCustomerNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer 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 as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCustomerAsync(String billingAccountId, String customerId) { + final String filter = null; + return new PagedFlux<>( + () -> listByCustomerSinglePageAsync(billingAccountId, customerId, filter), + nextLink -> listByCustomerNextSinglePageAsync(nextLink)); + } + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 lot summary as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByCustomerAsync( + String billingAccountId, String customerId, String filter, Context context) { + return new PagedFlux<>( + () -> listByCustomerSinglePageAsync(billingAccountId, customerId, filter, context), + nextLink -> listByCustomerNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer 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 as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCustomer(String billingAccountId, String customerId) { + final String filter = null; + return new PagedIterable<>(listByCustomerAsync(billingAccountId, customerId, filter)); + } + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 lot summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByCustomer( + String billingAccountId, String customerId, String filter, Context context) { + return new PagedIterable<>(listByCustomerAsync(billingAccountId, customerId, filter, context)); + } + /** * Get the next page of items. * @@ -476,7 +702,7 @@ public PagedIterable listByBillingAccount( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync(String nextLink) { @@ -513,7 +739,7 @@ private Mono> listByBillingProfileNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync( @@ -549,7 +775,7 @@ private Mono> listByBillingProfileNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountNextSinglePageAsync(String nextLink) { @@ -586,7 +812,7 @@ private Mono> listByBillingAccountNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingAccountNextSinglePageAsync( @@ -614,4 +840,75 @@ private Mono> listByBillingAccountNextSinglePageA 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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerNextSinglePageAsync(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.listByCustomerNext(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 along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByCustomerNextSinglePageAsync(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 + .listByCustomerNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } } diff --git a/sdk/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 82f0b140a011..11efdf49d1a4 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 @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; import com.azure.resourcemanager.consumption.models.LotSummary; import com.azure.resourcemanager.consumption.models.LotsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class LotsOperationsImpl implements LotsOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LotsOperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(LotsOperationsImpl.class); private final LotsOperationsClient innerClient; @@ -50,6 +49,18 @@ public PagedIterable listByBillingAccount(String billingAccountId, S return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } + public PagedIterable listByCustomer(String billingAccountId, String customerId) { + PagedIterable inner = this.serviceClient().listByCustomer(billingAccountId, customerId); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByCustomer( + String billingAccountId, String customerId, String filter, Context context) { + PagedIterable inner = + this.serviceClient().listByCustomer(billingAccountId, customerId, filter, context); + return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + private LotsOperationsClient serviceClient() { return this.innerClient; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java index 0584db96fe5a..b8f7b0d0270f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.MarketplacesClient; import com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner; import com.azure.resourcemanager.consumption.models.MarketplacesListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in MarketplacesClient. */ public final class MarketplacesClientImpl implements MarketplacesClient { - private final ClientLogger logger = new ClientLogger(MarketplacesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final MarketplacesService service; @@ -107,7 +104,7 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -171,7 +168,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -224,7 +221,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, String filter, Integer top, String skiptoken) { @@ -248,7 +245,7 @@ private PagedFlux listAsync(String scope, String filter, Integ * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -283,7 +280,7 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -309,7 +306,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -343,7 +340,7 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -358,7 +355,7 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -394,7 +391,7 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 marketplaces. + * @return result of listing marketplaces along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java index 5cab05762de7..7cc6b97013ed 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner; import com.azure.resourcemanager.consumption.models.Marketplace; import com.azure.resourcemanager.consumption.models.Marketplaces; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class MarketplacesImpl implements Marketplaces { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplacesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(MarketplacesImpl.class); private final MarketplacesClient innerClient; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java index 9146d37513df..757a725f2a01 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.OperationsClient; import com.azure.resourcemanager.consumption.fluent.models.OperationInner; import com.azure.resourcemanager.consumption.models.OperationListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in OperationsClient. */ public final class OperationsClientImpl implements OperationsClient { - private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final OperationsService service; @@ -85,7 +82,8 @@ Mono> listNext( * * @throws 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 consumption operations. + * @return result of listing consumption operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -118,7 +116,8 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 consumption operations. + * @return result of listing consumption operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -148,7 +147,7 @@ private Mono> listSinglePageAsync(Context context) * * @throws 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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -162,7 +161,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -175,7 +174,7 @@ private PagedFlux listAsync(Context context) { * * @throws 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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -189,7 +188,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -203,7 +202,8 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 consumption operations. + * @return result of listing consumption operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -239,7 +239,8 @@ private Mono> listNextSinglePageAsync(String nextL * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 consumption operations. + * @return result of listing consumption operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java index d7b61340083e..a37c89b5ed6f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.OperationInner; import com.azure.resourcemanager.consumption.models.Operation; import com.azure.resourcemanager.consumption.models.Operations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class OperationsImpl implements Operations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); private final OperationsClient innerClient; 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 e01c7433932a..79b2a8e97c00 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 @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.PriceSheetsClient; import com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in PriceSheetsClient. */ public final class PriceSheetsClientImpl implements PriceSheetsClient { - private final ClientLogger logger = new ClientLogger(PriceSheetsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final PriceSheetsService service; @@ -98,7 +95,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 subscription. + * @return the price sheet for a subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String expand, String skiptoken, Integer top) { @@ -144,7 +141,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 subscription. + * @return the price sheet for a subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( @@ -187,19 +184,11 @@ 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 subscription. + * @return the price sheet for a subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String expand, String skiptoken, Integer top) { - return getWithResponseAsync(expand, skiptoken, top) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(expand, skiptoken, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -207,22 +196,14 @@ private Mono getAsync(String expand, String skiptoken, In * * @throws 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 subscription. + * @return the price sheet for a subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync() { final String expand = null; final String skiptoken = null; final Integer top = null; - return getWithResponseAsync(expand, skiptoken, top) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(expand, skiptoken, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -253,7 +234,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 subscription. + * @return the price sheet for a subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( @@ -275,7 +256,8 @@ public Response getWithResponse( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByBillingPeriodWithResponseAsync( @@ -329,7 +311,8 @@ private Mono> getByBillingPeriodWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByBillingPeriodWithResponseAsync( @@ -379,20 +362,14 @@ private Mono> getByBillingPeriodWithResponseAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByBillingPeriodAsync( String billingPeriodName, String expand, String skiptoken, Integer top) { return getByBillingPeriodWithResponseAsync(billingPeriodName, expand, skiptoken, top) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -403,7 +380,8 @@ private Mono getByBillingPeriodAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByBillingPeriodAsync(String billingPeriodName) { @@ -411,14 +389,7 @@ private Mono getByBillingPeriodAsync(String billingPeriod final String skiptoken = null; final Integer top = null; return getByBillingPeriodWithResponseAsync(billingPeriodName, expand, skiptoken, top) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -454,7 +425,7 @@ public PriceSheetResultInner getByBillingPeriod(String billingPeriodName) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByBillingPeriodWithResponse( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsImpl.java index 88be3122b0c3..199dcf1bbac0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner; import com.azure.resourcemanager.consumption.models.PriceSheetResult; import com.azure.resourcemanager.consumption.models.PriceSheets; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class PriceSheetsImpl implements PriceSheets { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(PriceSheetsImpl.class); private final PriceSheetsClient innerClient; 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 309f8e08f003..834dec997ed8 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 @@ -21,10 +21,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ReservationRecommendationDetailsClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner; import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; import reactor.core.publisher.Mono; @@ -32,8 +32,6 @@ * An instance of this class provides access to all the operations defined in ReservationRecommendationDetailsClient. */ public final class ReservationRecommendationDetailsClientImpl implements ReservationRecommendationDetailsClient { - private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReservationRecommendationDetailsService service; @@ -63,13 +61,14 @@ public final class ReservationRecommendationDetailsClientImpl implements Reserva @ServiceInterface(name = "ConsumptionManagemen") private interface ReservationRecommendationDetailsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails") + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, + @QueryParam("scope") Scope scope, @QueryParam("region") String region, @QueryParam("term") Term term, @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, @@ -81,12 +80,13 @@ Mono> get( /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -95,17 +95,20 @@ Mono> 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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); + } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } @@ -129,6 +132,7 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), + resourceScope, scope, region, term, @@ -142,12 +146,13 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -157,17 +162,26 @@ private Mono> getWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return reservation recommendation details. + * @return reservation recommendation details along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( "Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); + } if (scope == null) { return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null.")); } @@ -189,6 +203,7 @@ private Mono> getWithRespon .get( this.client.getEndpoint(), this.client.getApiVersion(), + resourceScope, scope, region, term, @@ -201,12 +216,13 @@ private Mono> getWithRespon /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -215,31 +231,25 @@ private Mono> getWithRespon * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return reservation recommendation details. + * @return reservation recommendation details on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getWithResponseAsync(scope, region, term, lookBackPeriod, product) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getWithResponseAsync(resourceScope, scope, region, term, lookBackPeriod, product) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -252,19 +262,20 @@ private Mono getAsync( */ @ServiceMethod(returns = ReturnType.SINGLE) public ReservationRecommendationDetailsModelInner get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - return getAsync(scope, region, term, lookBackPeriod, product).block(); + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getAsync(resourceScope, scope, region, term, lookBackPeriod, product).block(); } /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -274,11 +285,17 @@ public ReservationRecommendationDetailsModelInner 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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { - return getWithResponseAsync(scope, region, term, lookBackPeriod, product, context).block(); + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context) { + return getWithResponseAsync(resourceScope, scope, region, term, lookBackPeriod, product, context).block(); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java index 1116ec92642f..7cc7c65fd422 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsImpl.java @@ -13,11 +13,11 @@ import com.azure.resourcemanager.consumption.models.LookBackPeriod; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetails; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsModel; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReservationRecommendationDetailsImpl implements ReservationRecommendationDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationRecommendationDetailsImpl.class); private final ReservationRecommendationDetailsClient innerClient; @@ -31,9 +31,9 @@ public ReservationRecommendationDetailsImpl( } public ReservationRecommendationDetailsModel get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { ReservationRecommendationDetailsModelInner inner = - this.serviceClient().get(scope, region, term, lookBackPeriod, product); + this.serviceClient().get(resourceScope, scope, region, term, lookBackPeriod, product); if (inner != null) { return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); } else { @@ -42,9 +42,15 @@ public ReservationRecommendationDetailsModel get( } public Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context) { Response inner = - this.serviceClient().getWithResponse(scope, region, term, lookBackPeriod, product, context); + this.serviceClient().getWithResponse(resourceScope, scope, region, term, lookBackPeriod, product, context); if (inner != null) { return new SimpleResponse<>( inner.getRequest(), diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java index 975c9309d1ab..aa5a7f342610 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ReservationRecommendationsClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import com.azure.resourcemanager.consumption.models.ReservationRecommendationsListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ReservationRecommendationsClient. */ public final class ReservationRecommendationsClientImpl implements ReservationRecommendationsClient { - private final ClientLogger logger = new ClientLogger(ReservationRecommendationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReservationRecommendationsService service; @@ -62,14 +59,14 @@ public final class ReservationRecommendationsClientImpl implements ReservationRe @ServiceInterface(name = "ConsumptionManagemen") private interface ReservationRecommendationsService { @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendations") + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendations") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, @HeaderParam("Accept") String accept, Context context); @@ -87,7 +84,7 @@ Mono> listNext( /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -102,25 +99,33 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String scope, String filter) { + private Mono> listSinglePageAsync( + String resourceScope, 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), scope, accept, context)) + .list( + this.client.getEndpoint(), + filter, + this.client.getApiVersion(), + resourceScope, + accept, + context)) .>map( res -> new PagedResponseBase<>( @@ -136,7 +141,7 @@ private Mono> listSinglePageAsync( /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -152,24 +157,25 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String scope, String filter, Context context) { + String resourceScope, 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), scope, accept, context) + .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), resourceScope, accept, context) .map( res -> new PagedResponseBase<>( @@ -184,7 +190,7 @@ private Mono> listSinglePageAsync( /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -199,17 +205,18 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String resourceScope, String filter) { + return new PagedFlux<>( + () -> listSinglePageAsync(resourceScope, filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -218,18 +225,19 @@ private PagedFlux listAsync(String scope, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { + private PagedFlux listAsync(String resourceScope) { final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(scope, filter), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>( + () -> listSinglePageAsync(resourceScope, filter), nextLink -> listNextSinglePageAsync(nextLink)); } /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -245,18 +253,19 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, String filter, Context context) { + private PagedFlux listAsync(String resourceScope, String filter, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + () -> listSinglePageAsync(resourceScope, filter, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -265,18 +274,18 @@ private PagedFlux listAsync(String scope, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { + public PagedIterable list(String resourceScope) { final String filter = null; - return new PagedIterable<>(listAsync(scope, filter)); + return new PagedIterable<>(listAsync(resourceScope, filter)); } /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -292,11 +301,11 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, String filter, Context context) { - return new PagedIterable<>(listAsync(scope, filter, context)); + public PagedIterable list(String resourceScope, String filter, Context context) { + return new PagedIterable<>(listAsync(resourceScope, filter, context)); } /** @@ -306,7 +315,8 @@ public PagedIterable list(String scope, String f * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -342,7 +352,8 @@ private Mono> listNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java index 654187b197f1..053900383342 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import com.azure.resourcemanager.consumption.models.ReservationRecommendation; import com.azure.resourcemanager.consumption.models.ReservationRecommendations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReservationRecommendationsImpl implements ReservationRecommendations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationRecommendationsImpl.class); private final ReservationRecommendationsClient innerClient; @@ -27,13 +26,13 @@ public ReservationRecommendationsImpl( this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); + public PagedIterable list(String resourceScope) { + PagedIterable inner = this.serviceClient().list(resourceScope); return Utils.mapPage(inner, inner1 -> new ReservationRecommendationImpl(inner1, this.manager())); } - public PagedIterable list(String scope, String filter, Context context) { - PagedIterable inner = this.serviceClient().list(scope, filter, context); + public PagedIterable list(String resourceScope, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(resourceScope, filter, context); return Utils.mapPage(inner, inner1 -> new ReservationRecommendationImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java index 6db0c98bfb33..1a4809cf094f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ReservationTransactionsClient; import com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionInner; import com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner; @@ -35,8 +34,6 @@ /** An instance of this class provides access to all the operations defined in ReservationTransactionsClient. */ public final class ReservationTransactionsClientImpl implements ReservationTransactionsClient { - private final ClientLogger logger = new ClientLogger(ReservationTransactionsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReservationTransactionsService service; @@ -113,15 +110,22 @@ Mono> listByBillingProfileNext } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -161,16 +165,23 @@ private Mono> listSinglePageAsync( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -201,15 +212,21 @@ private Mono> listSinglePageAsync( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String billingAccountId, String filter) { @@ -218,13 +235,16 @@ private PagedFlux listAsync(String billingAccountId } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String billingAccountId) { @@ -234,16 +254,22 @@ private PagedFlux listAsync(String billingAccountId } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String billingAccountId, String filter, Context context) { @@ -253,13 +279,16 @@ private PagedFlux listAsync(String billingAccountId } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String billingAccountId) { @@ -268,16 +297,22 @@ public PagedIterable list(String billingAccountId) } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String billingAccountId, String filter, Context context) { @@ -285,16 +320,22 @@ public PagedIterable list(String billingAccountId, } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -339,17 +380,23 @@ private Mono> listByBillingProf } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileSinglePageAsync( @@ -391,16 +438,21 @@ private Mono> listByBillingProf } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -411,14 +463,17 @@ private PagedFlux listByBillingProfileAsync( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -430,17 +485,22 @@ private PagedFlux listByBillingProfileAsync( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingProfileAsync( @@ -451,14 +511,17 @@ private PagedFlux listByBillingProfileAsync( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile( @@ -468,17 +531,22 @@ public PagedIterable listByBillingProfile( } /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingProfile( @@ -493,7 +561,8 @@ public PagedIterable listByBillingProfile( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -529,7 +598,8 @@ private Mono> listNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -564,7 +634,8 @@ private Mono> listNextSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync( @@ -602,7 +673,8 @@ private Mono> listByBillingProf * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation recommendations. + * @return result of listing reservation recommendations along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByBillingProfileNextSinglePageAsync( diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java index b91b2303ad4b..695e99674248 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.consumption.models.ModernReservationTransaction; import com.azure.resourcemanager.consumption.models.ReservationTransaction; import com.azure.resourcemanager.consumption.models.ReservationTransactions; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReservationTransactionsImpl implements ReservationTransactions { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationTransactionsImpl.class); private final ReservationTransactionsClient innerClient; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java index 405601530680..4eabdd3adffb 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ReservationsDetailsClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner; import com.azure.resourcemanager.consumption.models.ReservationDetailsListResult; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in ReservationsDetailsClient. */ public final class ReservationsDetailsClientImpl implements ReservationsDetailsClient { - private final ClientLogger logger = new ClientLogger(ReservationsDetailsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReservationsDetailsService service; @@ -89,12 +86,12 @@ Mono> listByReservationOrderAndReservatio Context context); @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationDetails") + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationDetails") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, @QueryParam("$filter") String filter, @@ -144,7 +141,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderSinglePageAsync( @@ -196,7 +194,8 @@ private Mono> listByReservationOrderSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderSinglePageAsync( @@ -239,7 +238,7 @@ private Mono> listByReservationOrderSingle * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAsync(String reservationOrderId, String filter) { @@ -258,7 +257,7 @@ private PagedFlux listByReservationOrderAsync(String res * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAsync( @@ -277,7 +276,7 @@ private PagedFlux listByReservationOrderAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrder(String reservationOrderId, String filter) { @@ -294,7 +293,7 @@ public PagedIterable listByReservationOrder(String reser * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrder( @@ -312,7 +311,8 @@ public PagedIterable listByReservationOrder( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationSinglePageAsync( @@ -369,7 +369,8 @@ private Mono> listByReservationOrderAndRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationSinglePageAsync( @@ -422,7 +423,7 @@ private Mono> listByReservationOrderAndRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAndReservationAsync( @@ -443,7 +444,7 @@ private PagedFlux listByReservationOrderAndReservationAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAndReservationAsync( @@ -464,7 +465,7 @@ private PagedFlux listByReservationOrderAndReservationAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrderAndReservation( @@ -484,7 +485,7 @@ public PagedIterable listByReservationOrderAndReservatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrderAndReservation( @@ -496,7 +497,7 @@ public PagedIterable listByReservationOrderAndReservatio /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -511,11 +512,12 @@ public PagedIterable listByReservationOrderAndReservatio * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String scope, + String resourceScope, String startDate, String endDate, String filter, @@ -527,8 +529,8 @@ private Mono> listSinglePageAsync( 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil @@ -537,7 +539,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - scope, + resourceScope, startDate, endDate, filter, @@ -561,7 +563,7 @@ private Mono> listSinglePageAsync( /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -577,11 +579,12 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String scope, + String resourceScope, String startDate, String endDate, String filter, @@ -594,15 +597,15 @@ private Mono> listSinglePageAsync( 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .list( this.client.getEndpoint(), - scope, + resourceScope, startDate, endDate, filter, @@ -625,7 +628,7 @@ private Mono> listSinglePageAsync( /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -640,49 +643,49 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String scope, + String resourceScope, String startDate, String endDate, String filter, String reservationId, String reservationOrderId) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId), + () -> listSinglePageAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { + private PagedFlux listAsync(String resourceScope) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId), + () -> listSinglePageAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -698,11 +701,11 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String scope, + String resourceScope, String startDate, String endDate, String filter, @@ -710,36 +713,39 @@ private PagedFlux listAsync( String reservationOrderId, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId, context), + () -> + listSinglePageAsync( + resourceScope, startDate, endDate, filter, reservationId, reservationOrderId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { + public PagedIterable list(String resourceScope) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; - return new PagedIterable<>(listAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId)); + return new PagedIterable<>( + listAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId)); } /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -755,11 +761,11 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String scope, + String resourceScope, String startDate, String endDate, String filter, @@ -767,7 +773,7 @@ public PagedIterable list( String reservationOrderId, Context context) { return new PagedIterable<>( - listAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId, context)); + listAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId, context)); } /** @@ -777,7 +783,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderNextSinglePageAsync(String nextLink) { @@ -814,7 +821,8 @@ private Mono> listByReservationOrderNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderNextSinglePageAsync( @@ -850,7 +858,8 @@ private Mono> listByReservationOrderNextSi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationNextSinglePageAsync( @@ -890,7 +899,8 @@ private Mono> listByReservationOrderAndRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationNextSinglePageAsync( @@ -926,7 +936,8 @@ private Mono> listByReservationOrderAndRes * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -962,7 +973,8 @@ private Mono> listNextSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation details. + * @return result of listing reservation details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java index baf24d702654..4666b5d71990 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner; import com.azure.resourcemanager.consumption.models.ReservationDetail; import com.azure.resourcemanager.consumption.models.ReservationsDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReservationsDetailsImpl implements ReservationsDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationsDetailsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationsDetailsImpl.class); private final ReservationsDetailsClient innerClient; @@ -56,13 +55,13 @@ public PagedIterable listByReservationOrderAndReservation( return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); + public PagedIterable list(String resourceScope) { + PagedIterable inner = this.serviceClient().list(resourceScope); return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } public PagedIterable list( - String scope, + String resourceScope, String startDate, String endDate, String filter, @@ -70,7 +69,9 @@ public PagedIterable list( String reservationOrderId, Context context) { PagedIterable inner = - this.serviceClient().list(scope, startDate, endDate, filter, reservationId, reservationOrderId, context); + this + .serviceClient() + .list(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId, context); return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } 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 18b19328a4ed..1ec1ea4f928a 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.ReservationsSummariesClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner; import com.azure.resourcemanager.consumption.models.Datagrain; @@ -34,8 +33,6 @@ /** An instance of this class provides access to all the operations defined in ReservationsSummariesClient. */ public final class ReservationsSummariesClientImpl implements ReservationsSummariesClient { - private final ClientLogger logger = new ClientLogger(ReservationsSummariesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final ReservationsSummariesService service; @@ -93,12 +90,12 @@ Mono> listByReservationOrderAndReservat Context context); @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationSummaries") + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, @QueryParam("grain") Datagrain grain, @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, @@ -150,7 +147,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderSinglePageAsync( @@ -204,7 +202,8 @@ private Mono> listByReservationOrderSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderSinglePageAsync( @@ -254,7 +253,7 @@ private Mono> listByReservationOrderSingl * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAsync( @@ -272,7 +271,7 @@ private PagedFlux listByReservationOrderAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAsync(String reservationOrderId, Datagrain grain) { @@ -293,7 +292,7 @@ private PagedFlux listByReservationOrderAsync(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAsync( @@ -311,7 +310,7 @@ private PagedFlux listByReservationOrderAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain) { @@ -330,7 +329,7 @@ public PagedIterable listByReservationOrder(String rese * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrder( @@ -349,7 +348,8 @@ public PagedIterable listByReservationOrder( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationSinglePageAsync( @@ -408,7 +408,8 @@ private Mono> listByReservationOrderAndRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationSinglePageAsync( @@ -463,7 +464,7 @@ private Mono> listByReservationOrderAndRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAndReservationAsync( @@ -482,7 +483,7 @@ private PagedFlux listByReservationOrderAndReservationA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAndReservationAsync( @@ -505,7 +506,7 @@ private PagedFlux listByReservationOrderAndReservationA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByReservationOrderAndReservationAsync( @@ -526,7 +527,7 @@ private PagedFlux listByReservationOrderAndReservationA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrderAndReservation( @@ -548,7 +549,7 @@ public PagedIterable listByReservationOrderAndReservati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByReservationOrderAndReservation( @@ -560,7 +561,7 @@ public PagedIterable listByReservationOrderAndReservati /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -576,11 +577,12 @@ public PagedIterable listByReservationOrderAndReservati * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -593,8 +595,8 @@ private Mono> listSinglePageAsync( 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } if (grain == null) { return Mono.error(new IllegalArgumentException("Parameter grain is required and cannot be null.")); @@ -606,7 +608,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - scope, + resourceScope, grain, startDate, endDate, @@ -631,7 +633,7 @@ private Mono> listSinglePageAsync( /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -648,11 +650,12 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -666,8 +669,8 @@ private Mono> listSinglePageAsync( 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 (resourceScope == null) { + return Mono.error(new IllegalArgumentException("Parameter resourceScope is required and cannot be null.")); } if (grain == null) { return Mono.error(new IllegalArgumentException("Parameter grain is required and cannot be null.")); @@ -677,7 +680,7 @@ private Mono> listSinglePageAsync( return service .list( this.client.getEndpoint(), - scope, + resourceScope, grain, startDate, endDate, @@ -701,7 +704,7 @@ private Mono> listSinglePageAsync( /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -717,11 +720,11 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -729,14 +732,16 @@ private PagedFlux listAsync( String reservationId, String reservationOrderId) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId), + () -> + listSinglePageAsync( + resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -744,24 +749,26 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope, Datagrain grain) { + private PagedFlux listAsync(String resourceScope, Datagrain grain) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; return new PagedFlux<>( - () -> listSinglePageAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId), + () -> + listSinglePageAsync( + resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -778,11 +785,11 @@ private PagedFlux listAsync(String scope, Datagrain gra * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -793,14 +800,14 @@ private PagedFlux listAsync( return new PagedFlux<>( () -> listSinglePageAsync( - scope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context), + resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -808,23 +815,23 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope, Datagrain grain) { + public PagedIterable list(String resourceScope, Datagrain grain) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; return new PagedIterable<>( - listAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId)); + listAsync(resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId)); } /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -841,11 +848,11 @@ public PagedIterable list(String scope, Datagrain grain * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -854,7 +861,7 @@ public PagedIterable list( String reservationOrderId, Context context) { return new PagedIterable<>( - listAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context)); + listAsync(resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context)); } /** @@ -864,7 +871,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderNextSinglePageAsync(String nextLink) { @@ -901,7 +909,8 @@ private Mono> listByReservationOrderNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderNextSinglePageAsync( @@ -937,7 +946,8 @@ private Mono> listByReservationOrderNextS * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationNextSinglePageAsync( @@ -977,7 +987,8 @@ private Mono> listByReservationOrderAndRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByReservationOrderAndReservationNextSinglePageAsync( @@ -1013,7 +1024,8 @@ private Mono> listByReservationOrderAndRe * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1049,7 +1061,8 @@ private Mono> listNextSinglePageAsync(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 reservation summaries. + * @return result of listing reservation summaries along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java index 05a85e5bf233..4ac4bc3ff390 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.models.Datagrain; import com.azure.resourcemanager.consumption.models.ReservationSummary; import com.azure.resourcemanager.consumption.models.ReservationsSummaries; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class ReservationsSummariesImpl implements ReservationsSummaries { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationsSummariesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(ReservationsSummariesImpl.class); private final ReservationsSummariesClient innerClient; @@ -57,13 +56,13 @@ public PagedIterable listByReservationOrderAndReservation( return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Datagrain grain) { - PagedIterable inner = this.serviceClient().list(scope, grain); + public PagedIterable list(String resourceScope, Datagrain grain) { + PagedIterable inner = this.serviceClient().list(resourceScope, grain); return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } public PagedIterable list( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, @@ -74,7 +73,7 @@ public PagedIterable list( PagedIterable inner = this .serviceClient() - .list(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context); + .list(resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context); return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java index 67df95a5b218..5d24c7d5f873 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java @@ -21,15 +21,12 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.TagsClient; import com.azure.resourcemanager.consumption.fluent.models.TagsResultInner; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in TagsClient. */ public final class TagsClientImpl implements TagsClient { - private final ClientLogger logger = new ClientLogger(TagsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final TagsService service; @@ -79,7 +76,8 @@ Mono> 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 all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope) { @@ -114,7 +112,8 @@ private Mono> getWithResponseAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope, Context context) { @@ -146,19 +145,11 @@ private Mono> getWithResponseAsync(String scope, Conte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available tag keys for the defined scope. + * @return all available tag keys for the defined scope on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String scope) { - return getWithResponseAsync(scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -197,7 +188,7 @@ public TagsResultInner get(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String scope, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsImpl.java index 66f604cb115e..58c43c4c426f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.fluent.models.TagsResultInner; import com.azure.resourcemanager.consumption.models.Tags; import com.azure.resourcemanager.consumption.models.TagsResult; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class TagsImpl implements Tags { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(TagsImpl.class); private final TagsClient innerClient; 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 44a113317cd0..a6fa5ff2bda1 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 @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.UsageDetailsClient; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import com.azure.resourcemanager.consumption.models.Metrictype; @@ -34,8 +33,6 @@ /** An instance of this class provides access to all the operations defined in UsageDetailsClient. */ public final class UsageDetailsClientImpl implements UsageDetailsClient { - private final ClientLogger logger = new ClientLogger(UsageDetailsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final UsageDetailsService service; @@ -62,7 +59,7 @@ public final class UsageDetailsClientImpl implements UsageDetailsClient { private interface UsageDetailsService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Consumption/usageDetails") - @ExpectedResponses({200}) + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @@ -78,7 +75,7 @@ Mono> list( @Headers({"Content-Type: application/json"}) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @@ -123,7 +120,8 @@ Mono> listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -202,7 +200,8 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -277,7 +276,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -311,7 +310,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -362,7 +361,7 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -396,7 +395,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -445,7 +444,7 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -460,7 +459,8 @@ public PagedIterable list( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -496,7 +496,8 @@ private Mono> listNextSinglePageAsync(String nex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 usage details. + * @return result of listing usage details along with {@link PagedResponse} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java index 0a2f97c4b4a8..a2b45996437c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java @@ -12,10 +12,9 @@ import com.azure.resourcemanager.consumption.models.Metrictype; import com.azure.resourcemanager.consumption.models.UsageDetail; import com.azure.resourcemanager.consumption.models.UsageDetails; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class UsageDetailsImpl implements UsageDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(UsageDetailsImpl.class); private final UsageDetailsClient innerClient; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java index 4f6201d53e82..9d4eaf6779a7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java @@ -31,7 +31,7 @@ public interface AggregatedCosts { * @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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ Response getByManagementGroupWithResponse( String managementGroupId, String filter, Context context); @@ -58,7 +58,7 @@ ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( * @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 management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ Response getForBillingPeriodByManagementGroupWithResponse( String managementGroupId, String billingPeriodName, Context context); 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..23b8382138ba 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The amount plus currency . */ @Immutable public class Amount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Amount.class); - /* * Amount currency. */ 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 56359257ad74..ed9a73463cd4 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 @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The amount with exchange rate. */ @Immutable public final class AmountWithExchangeRate extends Amount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(AmountWithExchangeRate.class); - /* * The exchange rate. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java index 28b35f39200b..22d8b8ad7b17 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The BalancePropertiesAdjustmentDetailsItem model. */ @Immutable public final class BalancePropertiesAdjustmentDetailsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalancePropertiesAdjustmentDetailsItem.class); - /* * the name of new adjustment. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java index 88f9ac43b8b4..ef9a6ffaa2c3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The BalancePropertiesNewPurchasesDetailsItem model. */ @Immutable public final class BalancePropertiesNewPurchasesDetailsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalancePropertiesNewPurchasesDetailsItem.class); - /* * the name of new purchase. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java index 285e4cd37caa..729e45a270e4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java @@ -30,7 +30,7 @@ public interface Balances { * @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 balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ Response getByBillingAccountWithResponse(String billingAccountId, Context context); @@ -57,7 +57,7 @@ public interface Balances { * @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 balances for a scope by billing period and billingAccountId. + * @return the balances for a scope by billing period and billingAccountId along with {@link Response}. */ Response getForBillingPeriodByBillingAccountWithResponse( String billingAccountId, String billingPeriodName, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BillingFrequency.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BillingFrequency.java index 9f47894ab8cb..29a8e81816af 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BillingFrequency.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BillingFrequency.java @@ -30,7 +30,11 @@ public static BillingFrequency fromString(String name) { return fromString(name, BillingFrequency.class); } - /** @return known BillingFrequency values. */ + /** + * Gets known BillingFrequency values. + * + * @return known BillingFrequency values. + */ public static Collection values() { return values(BillingFrequency.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java index 6c4ec428fb0d..9dbe70000c11 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The comparison expression to be used in the budgets. */ @Fluent public final class BudgetComparisonExpression { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetComparisonExpression.class); - /* * The name of the column to use in comparison. */ @@ -100,21 +97,23 @@ public BudgetComparisonExpression withValues(List values) { */ public void validate() { if (name() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property name in model BudgetComparisonExpression")); } if (operator() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property operator in model BudgetComparisonExpression")); } if (values() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property values in model BudgetComparisonExpression")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetComparisonExpression.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java index 7af3aa43443e..b353d7cf44c4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java @@ -5,28 +5,18 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** May be used to filter budgets by resource group, resource, or meter. */ @Fluent public final class BudgetFilter { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetFilter.class); - /* * The logical "AND" expression. Must have at least 2 items. */ @JsonProperty(value = "and") private List and; - /* - * The logical "NOT" expression. - */ - @JsonProperty(value = "not") - private BudgetFilterProperties not; - /* * Has comparison expression for a dimension */ @@ -59,26 +49,6 @@ public BudgetFilter withAnd(List and) { return this; } - /** - * Get the not property: The logical "NOT" expression. - * - * @return the not value. - */ - public BudgetFilterProperties not() { - return this.not; - } - - /** - * Set the not property: The logical "NOT" expression. - * - * @param not the not value to set. - * @return the BudgetFilter object itself. - */ - public BudgetFilter withNot(BudgetFilterProperties not) { - this.not = not; - return this; - } - /** * Get the dimensions property: Has comparison expression for a dimension. * @@ -128,9 +98,6 @@ public void validate() { if (and() != null) { and().forEach(e -> e.validate()); } - if (not() != null) { - not().validate(); - } if (dimensions() != null) { dimensions().validate(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java index 42ff353a3e6c..ccb3582ba2e8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Dimensions or Tags to filter a budget by. */ @Fluent public final class BudgetFilterProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetFilterProperties.class); - /* * Has comparison expression for a dimension */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java index 605b90e98c05..01e66602fe19 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java @@ -24,7 +24,11 @@ public static BudgetOperatorType fromString(String name) { return fromString(name, BudgetOperatorType.class); } - /** @return known BudgetOperatorType values. */ + /** + * Gets known BudgetOperatorType values. + * + * @return known BudgetOperatorType values. + */ public static Collection values() { return values(BudgetOperatorType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java index 05a038d2a479..dd2b1a6e3cf9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java @@ -6,15 +6,12 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; /** The start and end date for a budget. */ @Fluent public final class BudgetTimePeriod { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetTimePeriod.class); - /* * The start date for the budget. */ @@ -77,9 +74,11 @@ public BudgetTimePeriod withEndDate(OffsetDateTime endDate) { */ public void validate() { if (startDate() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property startDate in model BudgetTimePeriod")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetTimePeriod.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java index 30473f648fac..bd74ddb78e26 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java @@ -28,7 +28,7 @@ public interface Budgets { * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope); @@ -51,7 +51,7 @@ public interface Budgets { * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope, Context context); @@ -98,7 +98,7 @@ public interface Budgets { * @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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ Response getWithResponse(String scope, String budgetName, Context context); @@ -144,7 +144,7 @@ public interface Budgets { * @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 response. + * @return the {@link Response}. */ Response deleteWithResponse(String scope, String budgetName, Context context); @@ -155,7 +155,7 @@ public interface Budgets { * @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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ Budget getById(String id); @@ -167,7 +167,7 @@ public interface Budgets { * @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 budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ Response getByIdWithResponse(String id, Context context); @@ -189,7 +189,7 @@ public interface Budgets { * @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 response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java index bd33a65c2a2b..c043d1db7de5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.BudgetInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing budgets. It contains a list of available budgets in the scope provided. */ @Immutable public final class BudgetsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BudgetsListResult.class); - /* * The list of budgets. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java index cbdbc833c36e..d1b250a461c2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java @@ -24,7 +24,11 @@ public static CategoryType fromString(String name) { return fromString(name, CategoryType.class); } - /** @return known CategoryType values. */ + /** + * Gets known CategoryType values. + * + * @return known CategoryType values. + */ public static Collection values() { return values(CategoryType.class); } 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 05d8508577ba..ce4025d03527 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 @@ -6,8 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; @@ -26,8 +24,6 @@ }) @Fluent public class ChargeSummary extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargeSummary.class); - /* * eTag of the resource. To handle concurrent update scenario, this field * will be used to determine whether the user is updating the latest diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java index 73c6df33f98c..eadf2a3da82f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java @@ -27,7 +27,11 @@ public static ChargeSummaryKind fromString(String name) { return fromString(name, ChargeSummaryKind.class); } - /** @return known ChargeSummaryKind values. */ + /** + * Gets known ChargeSummaryKind values. + * + * @return known ChargeSummaryKind values. + */ public static Collection values() { return values(ChargeSummaryKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java index 16f0b73abd97..37dbc5da100f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java @@ -66,7 +66,7 @@ public interface Charges { * @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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ Response listWithResponse( String scope, String startDate, String endDate, String filter, String apply, Context context); 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 0610ce0df9c5..0a997823e6b7 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Summary of credit balances. */ @Immutable public final class CreditBalanceSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditBalanceSummary.class); - /* * Estimated balance. */ 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 c81237f13f37..1812d522e8e9 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 @@ -30,7 +30,7 @@ public interface Credits { * @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. + * @return a credit summary resource along with {@link Response}. */ 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 index a6e0879dd012..524511a16398 100644 --- 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 @@ -84,7 +84,11 @@ public static CultureCode fromString(String name) { return fromString(name, CultureCode.class); } - /** @return known CultureCode values. */ + /** + * Gets known CultureCode values. + * + * @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/CurrentSpend.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CurrentSpend.java index 7d1ef07753c7..423bc33036b7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CurrentSpend.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CurrentSpend.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The current amount of cost which is being tracked for a budget. */ @Immutable public final class CurrentSpend { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CurrentSpend.class); - /* * The total amount of cost which is being tracked by the budget. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java index d1552a898e91..caf4bdcb605b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java @@ -27,7 +27,11 @@ public static Datagrain fromString(String name) { return fromString(name, Datagrain.class); } - /** @return known Datagrain values. */ + /** + * Gets known Datagrain values. + * + * @return known Datagrain values. + */ public static Collection values() { return values(Datagrain.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java index f5962311e4e5..09837a6ee31f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java @@ -31,6 +31,9 @@ public final class EventType extends ExpandableStringEnum { /** Static value NewCredit for EventType. */ public static final EventType NEW_CREDIT = fromString("NewCredit"); + /** Static value CreditExpired for EventType. */ + public static final EventType CREDIT_EXPIRED = fromString("CreditExpired"); + /** * Creates or finds a EventType from its string representation. * @@ -42,7 +45,11 @@ public static EventType fromString(String name) { return fromString(name, EventType.class); } - /** @return known EventType values. */ + /** + * Gets known EventType values. + * + * @return known EventType values. + */ public static Collection values() { return values(EventType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java index f2c17db4b19b..e77de5fe1358 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing event summary. */ @Immutable public final class Events { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Events.class); - /* * The list of event summary. */ 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 8dba4861b35d..42b94ac9340e 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 @@ -20,7 +20,7 @@ public interface EventsOperations { * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingProfile( String billingAccountId, String billingProfileId, String startDate, String endDate); @@ -37,7 +37,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingProfile( String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); @@ -50,7 +50,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingAccount(String billingAccountId); @@ -66,7 +66,7 @@ PagedIterable listByBillingProfile( * @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. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java index 4ac1667b49b1..5240c761e805 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The forecasted cost which is being tracked for a budget. */ @Immutable public final class ForecastSpend { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ForecastSpend.class); - /* * The forecasted cost for the total time period which is being tracked by * the budget. This value is only provided if the budget contains a diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java index 084f7dd40a58..06f1c69d8d1d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LegacyChargeSummaryProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -18,8 +17,6 @@ @JsonTypeName("legacy") @Fluent public final class LegacyChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummary.class); - /* * Properties for legacy charge summary */ @@ -114,7 +111,7 @@ public String currency() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model LegacyChargeSummary")); @@ -122,4 +119,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(LegacyChargeSummary.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java index 6ede5b412f97..e1133c41f2fe 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LegacyReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -22,8 +21,6 @@ @JsonTypeName("legacy") @Fluent public final class LegacyReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendation.class); - /* * Properties for legacy reservation recommendation */ @@ -174,7 +171,7 @@ public List skuProperties() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model LegacyReservationRecommendation")); @@ -182,4 +179,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(LegacyReservationRecommendation.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java index e9ebfb4c40a4..f4fe429b485a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; /** Legacy Reservation transaction resource. */ @Immutable public final class LegacyReservationTransaction extends ReservationTransactionInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationTransaction.class); - /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java index df0ec268d775..6eda17f28065 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LegacyReservationRecommendationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,9 +15,6 @@ @Immutable public final class LegacySharedScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySharedScopeReservationRecommendationProperties.class); - /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java index 16fa7d307c55..1ef7f6a3347c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LegacyReservationRecommendationProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -19,9 +17,6 @@ @Immutable public final class LegacySingleScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySingleScopeReservationRecommendationProperties.class); - /* * Subscription id associated with single scoped recommendation. */ 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 3149ee726979..e7d084f22809 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 @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LegacyUsageDetailProperties; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,8 +20,6 @@ @JsonTypeName("legacy") @Fluent public final class LegacyUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetail.class); - /* * Properties for legacy usage details */ @@ -439,6 +436,24 @@ public BigDecimal payGPrice() { return this.innerProperties() == null ? null : this.innerProperties().payGPrice(); } + /** + * Get the benefitId property: Unique identifier for the applicable benefit. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.innerProperties() == null ? null : this.innerProperties().benefitId(); + } + + /** + * Get the benefitName property: Name of the applicable benefit. + * + * @return the benefitName value. + */ + public String benefitName() { + return this.innerProperties() == null ? null : this.innerProperties().benefitName(); + } + /** * Get the pricingModel property: Identifier that indicates how the meter is priced. * @@ -457,7 +472,7 @@ public PricingModelType pricingModel() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model LegacyUsageDetail")); @@ -465,4 +480,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(LegacyUsageDetail.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java index 3488a9665b86..1ca7e77134c2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java @@ -30,7 +30,11 @@ public static LookBackPeriod fromString(String name) { return fromString(name, LookBackPeriod.class); } - /** @return known LookBackPeriod values. */ + /** + * Gets known LookBackPeriod values. + * + * @return known LookBackPeriod values. + */ public static Collection values() { return values(LookBackPeriod.class); } 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 9db625833099..d274a5fb3c38 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 @@ -30,7 +30,11 @@ public static LotSource fromString(String name) { return fromString(name, LotSource.class); } - /** @return known LotSource values. */ + /** + * Gets known LotSource values. + * + * @return known LotSource values. + */ public static Collection values() { return values(LotSource.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java index 580dabac15b6..4293c234e587 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing lot summary. */ @Immutable public final class Lots { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Lots.class); - /* * The list of lot summary. */ 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 bab1d91c0f17..a94400053787 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,21 +10,21 @@ /** Resource collection API of LotsOperations. */ public interface LotsOperations { /** - * 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingProfile(String billingAccountId, String 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. + * Lists all Azure credits for a billing account or a billing profile. The API is only supported for Microsoft + * Customer Agreements (MCA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. @@ -32,25 +32,25 @@ public interface LotsOperations { * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ 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. + * Lists all Microsoft Azure consumption commitments for a billing account. The API is only supported for Microsoft + * Customer Agreements (MCA) and Direct Enterprise Agreement (EA) billing accounts. * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', @@ -60,7 +60,37 @@ public interface LotsOperations { * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCustomer(String billingAccountId, String customerId); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. 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 as paginated response with {@link PagedIterable}. + */ + PagedIterable listByCustomer( + String billingAccountId, String customerId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java index 82433cf0f866..cd4806323bf6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java @@ -25,7 +25,7 @@ public interface Marketplaces { * @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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope); @@ -53,7 +53,7 @@ public interface Marketplaces { * @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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope, String filter, Integer top, String skiptoken, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java index 2743240b9f0b..719684479e0b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class MarketplacesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplacesListResult.class); - /* * The list of marketplaces. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java index 26cbeec938a6..6e002b26269f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; /** The properties of the meter detail. */ @Immutable public final class MeterDetails { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MeterDetails.class); - /* * The name of the meter, within the given meter category */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java index 9a2fd82709ff..a9a668b83235 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The properties of the meter detail. */ @Immutable public final class MeterDetailsResponse { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MeterDetailsResponse.class); - /* * The name of the meter, within the given meter category */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java index 1d6e46c7ce5d..72cef74a3cbe 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java @@ -30,7 +30,11 @@ public static Metrictype fromString(String name) { return fromString(name, Metrictype.class); } - /** @return known Metrictype values. */ + /** + * Gets known Metrictype values. + * + * @return known Metrictype values. + */ public static Collection values() { return values(Metrictype.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java index d15dcf28111c..097ff7c3bee2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ModernChargeSummaryProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -17,8 +16,6 @@ @JsonTypeName("modern") @Fluent public final class ModernChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummary.class); - /* * Properties for modern charge summary */ @@ -149,7 +146,7 @@ public Boolean isInvoiced() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model ModernChargeSummary")); @@ -157,4 +154,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernChargeSummary.class); } 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 85f3bd155f59..3e03d155c799 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 @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ModernReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -22,8 +21,6 @@ @JsonTypeName("modern") @Fluent public final class ModernReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendation.class); - /* * Properties for modern reservation recommendation */ @@ -192,7 +189,7 @@ public String skuName() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model ModernReservationRecommendation")); @@ -200,4 +197,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernReservationRecommendation.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java index 47a4683b5847..36655b71f374 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java @@ -98,7 +98,7 @@ public interface ModernReservationTransaction { OffsetDateTime eventDate(); /** - * Gets the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Gets the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java index 77b4c8422ecb..8c42b94e6873 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing reservation recommendations. */ @Immutable public final class ModernReservationTransactionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionsListResult.class); - /* * The list of reservation recommendations. */ 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 8d35112b0136..0ed16b876c63 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 @@ -8,7 +8,6 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ModernUsageDetailProperties; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,8 +20,6 @@ @JsonTypeName("modern") @Fluent public final class ModernUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetail.class); - /* * Properties for modern usage details */ @@ -731,7 +728,7 @@ public String costAllocationRuleName() { public void validate() { super.validate(); if (innerProperties() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( "Missing required property innerProperties in model ModernUsageDetail")); @@ -739,4 +736,6 @@ public void validate() { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernUsageDetail.class); } 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..ba2f2751867a 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 @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.List; @@ -14,8 +13,6 @@ /** The notification associated with a budget. */ @Fluent public final class Notification { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Notification.class); - /* * The notification is enabled or not. */ @@ -247,19 +244,21 @@ public Notification withLocale(CultureCode locale) { */ public void validate() { if (operator() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property operator in model Notification")); } if (threshold() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property threshold in model Notification")); } if (contactEmails() == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException("Missing required property contactEmails in model Notification")); } } + + private static final ClientLogger LOGGER = new ClientLogger(Notification.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java index b8ba95d21220..d0242038c43a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The object that represents the operation. */ @Immutable public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Service provider: Microsoft.Consumption. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java index 2c57455a63d5..5b2149eaa804 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class OperationListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationListResult.class); - /* * List of consumption operations supported by the Microsoft.Consumption * resource provider. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operations.java index fb678e85b69a..d95f6ad5ab2f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operations.java @@ -14,7 +14,7 @@ public interface Operations { * * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -25,7 +25,7 @@ public interface Operations { * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java index 3646bcb45a45..5bf2ba6cfcc5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java @@ -30,7 +30,11 @@ public static OperatorType fromString(String name) { return fromString(name, OperatorType.class); } - /** @return known OperatorType values. */ + /** + * Gets known OperatorType values. + * + * @return known OperatorType values. + */ public static Collection values() { return values(OperatorType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java index b6643e12645f..2ce2190fd1aa 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.UUID; @@ -14,8 +12,6 @@ /** The properties of the price sheet. */ @Immutable public final class PriceSheetProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(PriceSheetProperties.class); - /* * The id of the billing period resource that the usage belongs to. */ 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 13bfc45db8b9..1da340c09e21 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 @@ -31,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 subscription. + * @return the price sheet for a subscription along with {@link Response}. */ Response getWithResponse(String expand, String skiptoken, Integer top, Context context); @@ -62,7 +62,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 and billing period. + * @return the price sheet for a scope by subscriptionId and billing period along with {@link Response}. */ Response getByBillingPeriodWithResponse( String billingPeriodName, String expand, String skiptoken, Integer top, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java index cb9d22a246d8..1c52913ca6d9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PricingModelType.java @@ -30,7 +30,11 @@ public static PricingModelType fromString(String name) { return fromString(name, PricingModelType.class); } - /** @return known PricingModelType values. */ + /** + * Gets known PricingModelType values. + * + * @return known PricingModelType values. + */ public static Collection values() { return values(PricingModelType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java index 029cada6fe01..87e9c7a2f1c4 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 @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The reseller properties. */ @Immutable public final class Reseller { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Reseller.class); - /* * The reseller property ID. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java index ffb854c4b8ff..18b146d27a3e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing reservation details. */ @Immutable public final class ReservationDetailsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailsListResult.class); - /* * The list of reservation details. */ 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 4c93fb135ef7..a589be4ce0ae 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,12 +12,13 @@ public interface ReservationRecommendationDetails { /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -29,17 +30,18 @@ public interface ReservationRecommendationDetails { * @return reservation recommendation details. */ ReservationRecommendationDetailsModel get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); /** * Details of a reservation recommendation for what-if analysis of reserved instances. * - * @param scope The scope associated with reservation recommendation details operations. This includes + * @param resourceScope The scope associated with reservation recommendation details operations. This includes * '/subscriptions/{subscriptionId}/' for subscription scope, * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope. + * @param scope Scope of the reservation. * @param region Used to select the region the recommendation should be generated for. * @param term Specify length of reservation recommendation term. * @param lookBackPeriod Filter the time period on which reservation recommendation results are based. @@ -49,8 +51,14 @@ ReservationRecommendationDetailsModel get( * @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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsCalculatedSavingsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsCalculatedSavingsProperties.java index 4810f2254a22..64c4c3e90741 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsCalculatedSavingsProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsCalculatedSavingsProperties.java @@ -5,17 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Details of estimated savings. */ @Fluent public final class ReservationRecommendationDetailsCalculatedSavingsProperties { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ReservationRecommendationDetailsCalculatedSavingsProperties.class); - /* * The cost without reservation. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java index 3835bf3903d9..651efe267253 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Details of the resource. */ @Immutable public final class ReservationRecommendationDetailsResourceProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsResourceProperties.class); - /* * List of subscriptions for which the reservation is applied. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java index 7753a58ff4e0..44992c1b1cbb 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Details of the estimated savings. */ @Fluent public final class ReservationRecommendationDetailsSavingsProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsSavingsProperties.class); - /* * List of calculated savings. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java index 76d401214b2f..b492aba7ed47 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java @@ -5,17 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Details about historical usage data that has been used for computing the recommendation. */ @Immutable public final class ReservationRecommendationDetailsUsageProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsUsageProperties.class); - /* * The first usage date used for looking back for computing the * recommendation. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java index 0111aee932c5..10a1bf7eed9c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java @@ -27,7 +27,11 @@ public static ReservationRecommendationKind fromString(String name) { return fromString(name, ReservationRecommendationKind.class); } - /** @return known ReservationRecommendationKind values. */ + /** + * Gets known ReservationRecommendationKind values. + * + * @return known ReservationRecommendationKind values. + */ public static Collection values() { return values(ReservationRecommendationKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java index adae056eabfe..1470f9fa1891 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java @@ -12,7 +12,7 @@ public interface ReservationRecommendations { /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -21,14 +21,14 @@ public interface ReservationRecommendations { * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** * List of recommendations for purchasing reserved instances. * - * @param scope The scope associated with reservation recommendations operations. This includes + * @param resourceScope The scope associated with reservation recommendations 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 @@ -44,7 +44,7 @@ public interface ReservationRecommendations { * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ - PagedIterable list(String scope, String filter, Context context); + PagedIterable list(String resourceScope, String filter, Context context); } 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 5de354242a73..da9c5273c456 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 @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing reservation recommendations. */ @Immutable public final class ReservationRecommendationsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationsListResult.class); - /* * The list of reservation recommendations. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java index e355ec17c10d..ed17b737411e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing reservation summaries. */ @Immutable public final class ReservationSummariesListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummariesListResult.class); - /* * The list of reservation summaries. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java index c5f47052b779..7c8989ffd536 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java @@ -64,7 +64,7 @@ public interface ReservationTransaction { String description(); /** - * Gets the eventType property: The type of the transaction (Purchase, Cancel, etc.). + * Gets the eventType property: The type of the transaction (Purchase, Cancel or Refund). * * @return the eventType value. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java index 16d5361a2471..b5f2d62b0b7c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java @@ -6,16 +6,12 @@ import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The Resource model definition. */ @Immutable public class ReservationTransactionResource extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionResource.class); - /* * Resource tags. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java index 5fc85b543a97..8e7469e32764 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java @@ -10,54 +10,71 @@ /** Resource collection API of ReservationTransactions. */ public interface ReservationTransactions { /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ PagedIterable list(String billingAccountId); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing account scope. Note: The refund transactions are posted + * along with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in + * May 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for the entire December 2020 month (i.e. will contain records for dates December 30 and + * 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ PagedIterable list(String billingAccountId, String filter, Context context); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId); /** - * List of transactions for reserved instances on billing account scope. + * List of transactions for reserved instances on billing profile scope. The refund transactions are posted along + * with its purchase transaction (i.e. in the purchase billing month). For example, The refund is requested in May + * 2021. This refund transaction will have event date as May 2021 but the billing month as April 2020 when the + * reservation purchase was made. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param filter Filter reservation transactions by date range. The properties/EventDate for start date and end - * date. The filter supports 'le' and 'ge'. + * date. The filter supports 'le' and 'ge'. Note: API returns data for the entire start date's and end date's + * billing month. For example, filter properties/eventDate+ge+2020-01-01+AND+properties/eventDate+le+2020-12-29 + * will include data for entire December 2020 month (i.e. will contain records for dates December 30 and 31). * @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 reservation recommendations. + * @return result of listing reservation recommendations as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingProfile( String billingAccountId, String billingProfileId, String filter, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java index f79c313d6d23..3c8cb4a27b75 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Result of listing reservation recommendations. */ @Immutable public final class ReservationTransactionsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionsListResult.class); - /* * The list of reservation recommendations. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java index 0bc6bc3f035a..9280a3b9152d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java @@ -18,7 +18,7 @@ public interface ReservationsDetails { * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrder(String reservationOrderId, String filter); @@ -32,7 +32,7 @@ public interface ReservationsDetails { * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrder(String reservationOrderId, String filter, Context context); @@ -46,7 +46,7 @@ public interface ReservationsDetails { * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrderAndReservation( String reservationOrderId, String reservationId, String filter); @@ -62,7 +62,7 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrderAndReservation( String reservationOrderId, String reservationId, String filter, Context context); @@ -70,21 +70,21 @@ PagedIterable listByReservationOrderAndReservation( /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** * Lists the reservations details for the defined scope and provided date range. * - * @param scope The scope associated with reservations details operations. This includes + * @param resourceScope The scope associated with reservations details operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -100,10 +100,10 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ PagedIterable list( - String scope, + String resourceScope, String startDate, String endDate, String filter, 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 a5c07b494c6c..cabc30020405 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 @@ -17,7 +17,7 @@ public interface ReservationsSummaries { * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain); @@ -32,7 +32,7 @@ public interface ReservationsSummaries { * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrder( String reservationOrderId, Datagrain grain, String filter, Context context); @@ -46,7 +46,7 @@ PagedIterable listByReservationOrder( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrderAndReservation( String reservationOrderId, String reservationId, Datagrain grain); @@ -63,7 +63,7 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ PagedIterable listByReservationOrderAndReservation( String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context); @@ -71,7 +71,7 @@ PagedIterable listByReservationOrderAndReservation( /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -79,14 +79,14 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ - PagedIterable list(String scope, Datagrain grain); + PagedIterable list(String resourceScope, Datagrain grain); /** * Lists the reservations summaries for the defined scope daily or monthly grain. * - * @param scope The scope associated with reservations summaries operations. This includes + * @param resourceScope The scope associated with reservations summaries operations. This includes * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * BillingProfile scope (modern). @@ -103,10 +103,10 @@ PagedIterable listByReservationOrderAndReservation( * @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 reservation summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ PagedIterable list( - String scope, + String resourceScope, Datagrain grain, String startDate, String endDate, diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java index 267f6e808f6a..4ccd981a57b7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Resource model definition. */ @Immutable public class ResourceAttributes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAttributes.class); - /* * Resource location */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java new file mode 100644 index 000000000000..834e51446360 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for Scope. */ +public final class Scope extends ExpandableStringEnum { + /** Static value Single for Scope. */ + public static final Scope SINGLE = fromString("Single"); + + /** Static value Shared for Scope. */ + public static final Scope SHARED = fromString("Shared"); + + /** + * Creates or finds a Scope from its string representation. + * + * @param name a name to look for. + * @return the corresponding Scope. + */ + @JsonCreator + public static Scope fromString(String name) { + return fromString(name, Scope.class); + } + + /** + * Gets known Scope values. + * + * @return known Scope values. + */ + public static Collection values() { + return values(Scope.class); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SkuProperty.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SkuProperty.java index 5f4126be7535..54c2e65c04a1 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SkuProperty.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SkuProperty.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The Sku property. */ @Immutable public final class SkuProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuProperty.class); - /* * The name of sku property. */ 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 index be3cc4f3b945..cb16a6374393 100644 --- 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 @@ -39,7 +39,11 @@ public static Status fromString(String name) { return fromString(name, Status.class); } - /** @return known Status values. */ + /** + * Gets known Status values. + * + * @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/Tag.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tag.java index 1c6eaf790788..7c7ac0d1fad9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tag.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tag.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The tag resource. */ @Fluent public final class Tag { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Tag.class); - /* * Tag key. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java index 45decbb6eebb..9e8c270fe735 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java @@ -42,7 +42,7 @@ public interface Tags { * @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 all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response}. */ Response getWithResponse(String scope, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java index bf14eb811c57..3bf62250a703 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java @@ -27,7 +27,11 @@ public static Term fromString(String name) { return fromString(name, Term.class); } - /** @return known Term values. */ + /** + * Gets known Term values. + * + * @return known Term values. + */ public static Collection values() { return values(Term.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java index f1a1ee1bb85c..3b48e15411db 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java @@ -27,7 +27,11 @@ public static ThresholdType fromString(String name) { return fromString(name, ThresholdType.class); } - /** @return known ThresholdType values. */ + /** + * Gets known ThresholdType values. + * + * @return known ThresholdType values. + */ public static Collection values() { return values(ThresholdType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java index 2da37ebc4ab5..3e2f6f83688c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java @@ -39,7 +39,11 @@ public static TimeGrainType fromString(String name) { return fromString(name, TimeGrainType.class); } - /** @return known TimeGrainType values. */ + /** + * Gets known TimeGrainType values. + * + * @return known TimeGrainType values. + */ public static Collection values() { return values(TimeGrainType.class); } 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 61734c007e49..5bb912048f1a 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 @@ -33,7 +33,7 @@ public interface UsageDetails { * @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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope); @@ -74,7 +74,7 @@ public interface UsageDetails { * @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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ PagedIterable list( String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java index 7f77f761d22c..8ca1fd114f5c 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java @@ -27,7 +27,11 @@ public static UsageDetailsKind fromString(String name) { return fromString(name, UsageDetailsKind.class); } - /** @return known UsageDetailsKind values. */ + /** + * Gets known UsageDetailsKind values. + * + * @return known UsageDetailsKind values. + */ public static Collection values() { return values(UsageDetailsKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java index 928d9f1da0c3..ba054af455a0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java @@ -5,9 +5,7 @@ package com.azure.resourcemanager.consumption.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -17,8 +15,6 @@ */ @Immutable public final class UsageDetailsListResult { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailsListResult.class); - /* * The list of usage details. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java new file mode 100644 index 000000000000..2311bfabdfbb --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for LotsOperation ListByCustomer. */ +public final class LotsOperationListByCustomerSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomer.json + */ + /** + * Sample code: LotsListByCustomer. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByCustomer(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByCustomer("1234:5678", "1234:5678", null, Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByCustomerWithFilters.json + */ + /** + * Sample code: LotsListByCustomerWithFilter. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByCustomerWithFilter(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager + .lotsOperations() + .listByCustomer( + "1234:5678", "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java new file mode 100644 index 000000000000..5c7eb3ace7d3 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +import com.azure.core.util.Context; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/OperationList.json + */ + /** + * Sample code: PriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java index 6ea6dcad3a88..df9f10a4abb0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationDetailsGetSamples.java @@ -6,6 +6,7 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; /** Samples for ReservationRecommendationDetails Get. */ @@ -22,7 +23,14 @@ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-00000000", + Scope.SINGLE, + "westus", + Term.P3Y, + LookBackPeriod.LAST30DAYS, + "Standard_DS13_v2", + Context.NONE); } /* @@ -38,7 +46,13 @@ public static void reservationRecommendationsByBillingProfileModern( manager .reservationRecommendationDetails() .getWithResponse( - "Shared", "australiaeast", Term.P1Y, LookBackPeriod.LAST7DAYS, "Standard_B2s", Context.NONE); + "providers/Microsoft.Billing/billingAccounts/00000000-0000-0000-0000-00000000:00000000-0000-0000-0000-00000000/billingProfiles/00000000-0000-0000-0000-00000000", + Scope.SHARED, + "australiaeast", + Term.P1Y, + LookBackPeriod.LAST7DAYS, + "Standard_B2s", + Context.NONE); } /* @@ -53,7 +67,14 @@ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup", + Scope.SINGLE, + "westus", + Term.P3Y, + LookBackPeriod.LAST30DAYS, + "Standard_DS13_v2", + Context.NONE); } /* @@ -68,6 +89,13 @@ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendationDetails() - .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + .getWithResponse( + "providers/Microsoft.Billing/billingAccounts/000000", + Scope.SHARED, + "eastus", + Term.P1Y, + LookBackPeriod.LAST60DAYS, + "Standard_DS14_v2", + Context.NONE); } }