diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index b713d35da2bad..ff1b938ced555 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 (2023-05-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-2023-03. 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 4bc0fe107d500..87c3edd59d2be 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/README.md +++ b/sdk/consumption/azure-resourcemanager-consumption/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Consumption client library for Java. -This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Consumption Management SDK. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2023-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-consumption - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md index a96cb65e90538..e1191855c43fa 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md +++ b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md @@ -35,13 +35,19 @@ - [ListByBillingAccount](#lotsoperation_listbybillingaccount) - [ListByBillingProfile](#lotsoperation_listbybillingprofile) +- [ListByCustomer](#lotsoperation_listbycustomer) ## Marketplaces - [List](#marketplaces_list) +## Operations + +- [List](#operations_list) + ## PriceSheet +- [DownloadByBillingAccountPeriod](#pricesheet_downloadbybillingaccountperiod) - [Get](#pricesheet_get) - [GetByBillingPeriod](#pricesheet_getbybillingperiod) @@ -80,12 +86,10 @@ ### AggregatedCost_GetByManagementGroup ```java -import com.azure.core.util.Context; - /** Samples for AggregatedCost GetByManagementGroup. */ public final class AggregatedCostGetByManagementGroupSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroupFilterByDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostByManagementGroupFilterByDate.json */ /** * Sample code: AggregatedCostByManagementGroupFilterByDate. @@ -99,11 +103,11 @@ public final class AggregatedCostGetByManagementGroupSamples { .getByManagementGroupWithResponse( "managementGroupForTest", "usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostByManagementGroup.json */ /** * Sample code: AggregatedCostByManagementGroup. @@ -112,7 +116,9 @@ public final class AggregatedCostGetByManagementGroupSamples { */ public static void aggregatedCostByManagementGroup( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + manager + .aggregatedCosts() + .getByManagementGroupWithResponse("managementGroupForTest", null, com.azure.core.util.Context.NONE); } } ``` @@ -120,12 +126,10 @@ public final class AggregatedCostGetByManagementGroupSamples { ### AggregatedCost_GetForBillingPeriodByManagementGroup ```java -import com.azure.core.util.Context; - /** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json */ /** * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. @@ -136,7 +140,8 @@ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .aggregatedCosts() - .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); + .getForBillingPeriodByManagementGroupWithResponse( + "managementGroupForTest", "201807", com.azure.core.util.Context.NONE); } } ``` @@ -144,12 +149,10 @@ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { ### Balances_GetByBillingAccount ```java -import com.azure.core.util.Context; - /** Samples for Balances GetByBillingAccount. */ public final class BalancesGetByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BalancesByBillingAccount.json */ /** * Sample code: Balances. @@ -157,7 +160,7 @@ public final class BalancesGetByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + manager.balances().getByBillingAccountWithResponse("123456", com.azure.core.util.Context.NONE); } } ``` @@ -165,12 +168,10 @@ public final class BalancesGetByBillingAccountSamples { ### Balances_GetForBillingPeriodByBillingAccount ```java -import com.azure.core.util.Context; - /** Samples for Balances GetForBillingPeriodByBillingAccount. */ public final class BalancesGetForBillingPeriodByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccountForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BalancesByBillingAccountForBillingPeriod.json */ /** * Sample code: Balances. @@ -178,7 +179,9 @@ public final class BalancesGetForBillingPeriodByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + manager + .balances() + .getForBillingPeriodByBillingAccountWithResponse("123456", "201702", com.azure.core.util.Context.NONE); } } ``` @@ -206,7 +209,7 @@ import java.util.Map; /** Samples for Budgets CreateOrUpdate. */ public final class BudgetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreateOrUpdateBudget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/CreateOrUpdateBudget.json */ /** * Sample code: CreateOrUpdateBudget. @@ -287,12 +290,10 @@ public final class BudgetsCreateOrUpdateSamples { ### Budgets_Delete ```java -import com.azure.core.util.Context; - /** Samples for Budgets Delete. */ public final class BudgetsDeleteSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/DeleteBudget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/DeleteBudget.json */ /** * Sample code: DeleteBudget. @@ -302,7 +303,8 @@ public final class BudgetsDeleteSamples { public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .budgets() - .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + .deleteByResourceGroupWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } } ``` @@ -310,12 +312,10 @@ public final class BudgetsDeleteSamples { ### Budgets_Get ```java -import com.azure.core.util.Context; - /** Samples for Budgets Get. */ public final class BudgetsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Budget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/Budget.json */ /** * Sample code: Budget. @@ -325,7 +325,8 @@ public final class BudgetsGetSamples { public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .budgets() - .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } } ``` @@ -333,12 +334,10 @@ public final class BudgetsGetSamples { ### Budgets_List ```java -import com.azure.core.util.Context; - /** Samples for Budgets List. */ public final class BudgetsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BudgetsList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BudgetsList.json */ /** * Sample code: BudgetsList. @@ -346,7 +345,7 @@ public final class BudgetsListSamples { * @param manager Entry point to ConsumptionManager. */ public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); } } ``` @@ -354,12 +353,10 @@ public final class BudgetsListSamples { ### Charges_List ```java -import com.azure.core.util.Context; - /** Samples for Charges List. */ public final class ChargesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccount.json */ /** * Sample code: ChargesListByBillingAccount-Modern. @@ -376,11 +373,11 @@ public final class ChargesListSamples { "2019-10-31", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. @@ -397,11 +394,11 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json */ /** * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. @@ -418,11 +415,11 @@ public final class ChargesListSamples { "2019-09-30", null, "groupby((properties/customerId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfile.json */ /** * Sample code: ChargesListByBillingProfile-Modern. @@ -439,11 +436,11 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileInvoiceSection.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfileInvoiceSection.json */ /** * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. @@ -460,11 +457,11 @@ public final class ChargesListSamples { "2019-10-31", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernCustomer.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernCustomer.json */ /** * Sample code: ChargesListByCustomer-Modern. @@ -480,11 +477,11 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForDepartmentFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListForDepartmentFilterByStartEndDate.json */ /** * Sample code: ChargesListByDepartment-Legacy. @@ -500,11 +497,11 @@ public final class ChargesListSamples { null, "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json */ /** * Sample code: ChargesListForEnrollmentAccount-Legacy. @@ -521,11 +518,11 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. @@ -542,11 +539,11 @@ public final class ChargesListSamples { "2019-09-30", null, "groupby((properties/invoiceSectionId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json */ /** * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. @@ -563,11 +560,11 @@ public final class ChargesListSamples { "2019-09-30", null, "groupby((properties/billingProfileId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. @@ -584,11 +581,11 @@ public final class ChargesListSamples { "2019-09-30", null, "groupby((properties/invoiceSectionId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesForBillingPeriodByDepartment.json */ /** * Sample code: ChangesForBillingPeriodByDepartment-Legacy. @@ -605,11 +602,11 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernInvoiceSectionId.json */ /** * Sample code: ChargesListByInvoiceSectionId-Modern. @@ -626,7 +623,7 @@ public final class ChargesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -634,12 +631,10 @@ public final class ChargesListSamples { ### Credits_Get ```java -import com.azure.core.util.Context; - /** Samples for Credits Get. */ public final class CreditsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreditSummaryByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/CreditSummaryByBillingProfile.json */ /** * Sample code: CreditSummaryByBillingProfile. @@ -647,7 +642,7 @@ public final class CreditsGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + manager.credits().getWithResponse("1234:5678", "2468", com.azure.core.util.Context.NONE); } } ``` @@ -655,12 +650,10 @@ public final class CreditsGetSamples { ### EventsOperation_ListByBillingAccount ```java -import com.azure.core.util.Context; - /** Samples for EventsOperation ListByBillingAccount. */ public final class EventsOperationListByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsGetByBillingAccount.json */ /** * Sample code: EventsGetByBillingAccount. @@ -668,11 +661,11 @@ public final class EventsOperationListByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.eventsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccountWithFilters.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsGetByBillingAccountWithFilters.json */ /** * Sample code: EventsGetByBillingAccountWithFilters. @@ -684,7 +677,9 @@ public final class EventsOperationListByBillingAccountSamples { manager .eventsOperations() .listByBillingAccount( - "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + "1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); } } ``` @@ -692,12 +687,10 @@ public final class EventsOperationListByBillingAccountSamples { ### EventsOperation_ListByBillingProfile ```java -import com.azure.core.util.Context; - /** Samples for EventsOperation ListByBillingProfile. */ public final class EventsOperationListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsListByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsListByBillingProfile.json */ /** * Sample code: EventsListByBillingProfile. @@ -705,7 +698,9 @@ public final class EventsOperationListByBillingProfileSamples { * @param manager Entry point to ConsumptionManager. */ public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + manager + .eventsOperations() + .listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", com.azure.core.util.Context.NONE); } } ``` @@ -713,12 +708,10 @@ public final class EventsOperationListByBillingProfileSamples { ### LotsOperation_ListByBillingAccount ```java -import com.azure.core.util.Context; - /** Samples for LotsOperation ListByBillingAccount. */ public final class LotsOperationListByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingAccount.json */ /** * Sample code: LotsListByBillingAccount. @@ -726,11 +719,11 @@ public final class LotsOperationListByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccountWithFilters.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingAccountWithFilters.json */ /** * Sample code: LotsListByBillingAccountWithStatusFilter. @@ -742,7 +735,9 @@ public final class LotsOperationListByBillingAccountSamples { manager .lotsOperations() .listByBillingAccount( - "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + "1234:5678", + "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); } } ``` @@ -750,12 +745,10 @@ public final class LotsOperationListByBillingAccountSamples { ### LotsOperation_ListByBillingProfile ```java -import com.azure.core.util.Context; - /** Samples for LotsOperation ListByBillingProfile. */ public final class LotsOperationListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingProfile.json */ /** * Sample code: LotsListByBillingProfile. @@ -763,20 +756,55 @@ public final class LotsOperationListByBillingProfileSamples { * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + manager.lotsOperations().listByBillingProfile("1234:5678", "2468", com.azure.core.util.Context.NONE); } } ``` -### Marketplaces_List +### 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/2023-03-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, com.azure.core.util.Context.NONE); + } + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-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'", + com.azure.core.util.Context.NONE); + } +} +``` + +### Marketplaces_List + +```java /** Samples for Marketplaces List. */ public final class MarketplacesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json */ /** * Sample code: BillingAccountMarketplacesListForBillingPeriod. @@ -787,11 +815,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json */ /** * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. @@ -802,11 +835,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/enrollmentAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesList.json */ /** * Sample code: SubscriptionMarketplacesList. @@ -816,11 +854,16 @@ public final class MarketplacesListSamples { public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccountList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByEnrollmentAccountList.json */ /** * Sample code: EnrollmentAccountMarketplacesList. @@ -831,11 +874,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/enrollmentAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json */ /** * Sample code: DepartmentMarketplacesListForBillingPeriod. @@ -844,11 +892,13 @@ public final class MarketplacesListSamples { */ public static void departmentMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + manager + .marketplaces() + .list("providers/Microsoft.Billing/departments/123456", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroupList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByManagementGroupList.json */ /** * Sample code: ManagementGroupMarketplacesList. @@ -859,11 +909,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesListForBillingPeriod.json */ /** * Sample code: SubscriptionMarketplacesListForBillingPeriod. @@ -874,11 +929,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartmentList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByDepartmentList.json */ /** * Sample code: DepartmentMarketplacesList. @@ -886,11 +946,13 @@ public final class MarketplacesListSamples { * @param manager Entry point to ConsumptionManager. */ public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + manager + .marketplaces() + .list("providers/Microsoft.Billing/departments/123456", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json */ /** * Sample code: ManagementGroupMarketplacesListForBillingPeriod. @@ -901,11 +963,16 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByBillingAccountList.json */ /** * Sample code: BillingAccountMarketplacesList. @@ -916,20 +983,61 @@ public final class MarketplacesListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } } ``` -### PriceSheet_Get +### 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/2023-03-01/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void operationList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### PriceSheet_DownloadByBillingAccountPeriod +```java +/** Samples for PriceSheet DownloadByBillingAccountPeriod. */ +public final class PriceSheetDownloadByBillingAccountPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EAPriceSheetForBillingPeriod.json + */ + /** + * Sample code: EAPriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eAPriceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().downloadByBillingAccountPeriod("0000000", "202305", com.azure.core.util.Context.NONE); + } +} +``` + +### PriceSheet_Get + +```java /** Samples for PriceSheet Get. */ public final class PriceSheetGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheet.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheet.json */ /** * Sample code: PriceSheet. @@ -937,7 +1045,7 @@ public final class PriceSheetGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getWithResponse(null, null, null, Context.NONE); + manager.priceSheets().getWithResponse(null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -945,12 +1053,10 @@ public final class PriceSheetGetSamples { ### PriceSheet_GetByBillingPeriod ```java -import com.azure.core.util.Context; - /** Samples for PriceSheet GetByBillingPeriod. */ public final class PriceSheetGetByBillingPeriodSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheetForBillingPeriod.json */ /** * Sample code: PriceSheetForBillingPeriod. @@ -958,11 +1064,13 @@ public final class PriceSheetGetByBillingPeriodSamples { * @param manager Entry point to ConsumptionManager. */ public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + manager + .priceSheets() + .getByBillingPeriodWithResponse("201801", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheetExpand.json */ /** * Sample code: PriceSheetExpand. @@ -970,7 +1078,9 @@ public final class PriceSheetGetByBillingPeriodSamples { * @param manager Entry point to ConsumptionManager. */ public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + manager + .priceSheets() + .getByBillingPeriodWithResponse("201801", "meterDetails", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -978,14 +1088,14 @@ public final class PriceSheetGetByBillingPeriodSamples { ### ReservationRecommendationDetails_Get ```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. */ public final class ReservationRecommendationDetailsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsBySubscription.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. @@ -996,11 +1106,18 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. @@ -1012,11 +1129,17 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByResourceGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. @@ -1027,11 +1150,18 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. @@ -1042,7 +1172,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", + com.azure.core.util.Context.NONE); } } ``` @@ -1050,12 +1187,10 @@ public final class ReservationRecommendationDetailsGetSamples { ### ReservationRecommendations_List ```java -import com.azure.core.util.Context; - /** Samples for ReservationRecommendations List. */ public final class ReservationRecommendationsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsBySubscription.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. @@ -1066,11 +1201,11 @@ public final class ReservationRecommendationsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. @@ -1081,11 +1216,14 @@ public final class ReservationRecommendationsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByResourceGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. @@ -1096,11 +1234,14 @@ public final class ReservationRecommendationsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json */ /** * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. @@ -1114,11 +1255,11 @@ public final class ReservationRecommendationsListSamples { .list( "subscriptions/00000000-0000-0000-0000-000000000000", "properties/scope eq 'Single' AND properties/lookBackPeriod eq 'Last7Days'", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. @@ -1129,7 +1270,7 @@ public final class ReservationRecommendationsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); + .list("providers/Microsoft.Billing/billingAccounts/123456", null, com.azure.core.util.Context.NONE); } } ``` @@ -1137,12 +1278,12 @@ public final class ReservationRecommendationsListSamples { ### ReservationTransactions_List ```java -import com.azure.core.util.Context; +import java.math.BigDecimal; /** Samples for ReservationTransactions List. */ public final class ReservationTransactionsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByEnrollmentNumber.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationTransactionsListByEnrollmentNumber.json */ /** * Sample code: ReservationTransactionsByEnrollmentNumber. @@ -1153,7 +1294,12 @@ public final class ReservationTransactionsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationTransactions() - .list("123456", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", Context.NONE); + .list( + "123456", + "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", + true, + new BigDecimal("15.5"), + com.azure.core.util.Context.NONE); } } ``` @@ -1161,12 +1307,10 @@ public final class ReservationTransactionsListSamples { ### ReservationTransactions_ListByBillingProfile ```java -import com.azure.core.util.Context; - /** Samples for ReservationTransactions ListByBillingProfile. */ public final class ReservationTransactionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationTransactionsListByBillingProfileId.json */ /** * Sample code: ReservationTransactionsByBillingProfileId. @@ -1181,7 +1325,7 @@ public final class ReservationTransactionsListByBillingProfileSamples { "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", "Z76D-SGAF-BG7-TGB", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1189,12 +1333,10 @@ public final class ReservationTransactionsListByBillingProfileSamples { ### ReservationsDetails_List ```java -import com.azure.core.util.Context; - /** Samples for ReservationsDetails List. */ public final class ReservationsDetailsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingProfileIdReservationId.json */ /** * Sample code: ReservationDetailsByBillingProfileIdReservationId. @@ -1212,11 +1354,11 @@ public final class ReservationsDetailsListSamples { null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingAccountId.json */ /** * Sample code: ReservationDetailsByBillingAccountId. @@ -1234,11 +1376,11 @@ public final class ReservationsDetailsListSamples { "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingProfileId.json */ /** * Sample code: ReservationDetailsByBillingProfileId. @@ -1256,7 +1398,7 @@ public final class ReservationsDetailsListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1264,12 +1406,10 @@ public final class ReservationsDetailsListSamples { ### ReservationsDetails_ListByReservationOrder ```java -import com.azure.core.util.Context; - /** Samples for ReservationsDetails ListByReservationOrder. */ public final class ReservationsDetailsListByReservationOrderSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetails.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetails.json */ /** * Sample code: ReservationDetails. @@ -1282,7 +1422,7 @@ public final class ReservationsDetailsListByReservationOrderSamples { .listByReservationOrder( "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1290,12 +1430,10 @@ public final class ReservationsDetailsListByReservationOrderSamples { ### ReservationsDetails_ListByReservationOrderAndReservation ```java -import com.azure.core.util.Context; - /** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ public final class ReservationsDetailsListByReservationOrderAndReservationSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsWithReservationId.json */ /** * Sample code: ReservationDetailsWithReservationId. @@ -1310,7 +1448,7 @@ public final class ReservationsDetailsListByReservationOrderAndReservationSample "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1318,13 +1456,12 @@ public final class ReservationsDetailsListByReservationOrderAndReservationSample ### ReservationsSummaries_List ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries List. */ public final class ReservationsSummariesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesDailyWithBillingAccountId. @@ -1343,11 +1480,11 @@ public final class ReservationsSummariesListSamples { "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesDailyWithBillingProfileId. @@ -1366,11 +1503,11 @@ public final class ReservationsSummariesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingAccountId. @@ -1389,11 +1526,11 @@ public final class ReservationsSummariesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileId. @@ -1412,11 +1549,11 @@ public final class ReservationsSummariesListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. @@ -1435,7 +1572,7 @@ public final class ReservationsSummariesListSamples { null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1443,13 +1580,12 @@ public final class ReservationsSummariesListSamples { ### ReservationsSummaries_ListByReservationOrder ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrder. */ public final class ReservationsSummariesListByReservationOrderSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthly.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthly.json */ /** * Sample code: ReservationSummariesMonthly. @@ -1459,11 +1595,12 @@ public final class ReservationsSummariesListByReservationOrderSamples { public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationsSummaries() - .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); + .listByReservationOrder( + "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDaily.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDaily.json */ /** * Sample code: ReservationSummariesDaily. @@ -1477,7 +1614,7 @@ public final class ReservationsSummariesListByReservationOrderSamples { "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1485,13 +1622,12 @@ public final class ReservationsSummariesListByReservationOrderSamples { ### ReservationsSummaries_ListByReservationOrderAndReservation ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ public final class ReservationsSummariesListByReservationOrderAndReservationSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithReservationId.json */ /** * Sample code: ReservationSummariesDailyWithReservationId. @@ -1507,11 +1643,11 @@ public final class ReservationsSummariesListByReservationOrderAndReservationSamp "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithReservationId. @@ -1527,7 +1663,7 @@ public final class ReservationsSummariesListByReservationOrderAndReservationSamp "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1535,12 +1671,10 @@ public final class ReservationsSummariesListByReservationOrderAndReservationSamp ### Tags_Get ```java -import com.azure.core.util.Context; - /** Samples for Tags Get. */ public final class TagsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Tags.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/Tags.json */ /** * Sample code: Tags_Get. @@ -1548,7 +1682,10 @@ public final class TagsGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + manager + .tags() + .getWithResponse( + "providers/Microsoft.CostManagement/billingAccounts/1234", com.azure.core.util.Context.NONE); } } ``` @@ -1556,13 +1693,12 @@ public final class TagsGetSamples { ### UsageDetails_List ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Metrictype; /** Samples for UsageDetails List. */ public final class UsageDetailsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. @@ -1573,11 +1709,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCAInvoiceSection.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCAInvoiceSection.json */ /** * Sample code: InvoiceSectionUsageDetailsList-Modern. @@ -1595,11 +1738,11 @@ public final class UsageDetailsListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsList.json */ /** * Sample code: UsageDetailsList-Legacy. @@ -1609,11 +1752,18 @@ public final class UsageDetailsListSamples { public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListFilterByTag.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListFilterByTag.json */ /** * Sample code: UsageDetailsListFilterByTag-Legacy. @@ -1631,11 +1781,11 @@ public final class UsageDetailsListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Legacy. @@ -1646,11 +1796,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCABillingProfile.json */ /** * Sample code: BillingProfileUsageDetailsList-Modern. @@ -1668,11 +1825,11 @@ public final class UsageDetailsListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByDepartment.json */ /** * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. @@ -1683,11 +1840,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/Departments/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. @@ -1698,11 +1862,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricAmortizedCost.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricAmortizedCost.json */ /** * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. @@ -1720,11 +1891,11 @@ public final class UsageDetailsListSamples { null, null, Metrictype.AMORTIZEDCOST, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricUsage.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricUsage.json */ /** * Sample code: UsageDetailsListByMetricUsage-Legacy. @@ -1742,11 +1913,11 @@ public final class UsageDetailsListSamples { null, null, Metrictype.USAGE, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsList-Legacy. @@ -1757,11 +1928,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByDepartment.json */ /** * Sample code: DepartmentUsageDetailsList-Legacy. @@ -1772,11 +1950,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/Departments/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricActualCost.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricActualCost.json */ /** * Sample code: UsageDetailsListByMetricActualCost-Legacy. @@ -1794,11 +1979,11 @@ public final class UsageDetailsListSamples { null, null, Metrictype.ACTUALCOST, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsList-Legacy. @@ -1809,11 +1994,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/EnrollmentAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCABillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Modern. @@ -1824,11 +2016,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234:56789", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCACustomer.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCACustomer.json */ /** * Sample code: CustomerUsageDetailsList-Modern. @@ -1846,11 +2045,11 @@ public final class UsageDetailsListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsExpand.json */ /** * Sample code: UsageDetailsExpand-Legacy. @@ -1867,11 +2066,11 @@ public final class UsageDetailsListSamples { null, 1, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. @@ -1882,11 +2081,18 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/EnrollmentAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriod.json */ /** * Sample code: UsageDetailsListForBillingPeriod-Legacy. @@ -1897,7 +2103,14 @@ public final class UsageDetailsListSamples { com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/consumption/azure-resourcemanager-consumption/pom.xml b/sdk/consumption/azure-resourcemanager-consumption/pom.xml index 65c476e59387a..4dbd8f0a84391 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/pom.xml +++ b/sdk/consumption/azure-resourcemanager-consumption/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for Consumption Management - This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2021-10. + This package contains Microsoft Azure SDK for Consumption Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. Package tag package-2023-03. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 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 fba2874342776..8812df1bfd841 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 813767044909a..30446c9fc6af1 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 @@ -16,57 +16,57 @@ public interface AggregatedCostsClient { * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. + * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', + * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagementGroupAggregatedCostResultInner getByManagementGroup(String managementGroupId); + Response getByManagementGroupWithResponse( + String managementGroupId, String filter, Context context); /** * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. - * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc - * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', - * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByManagementGroupWithResponse( - String managementGroupId, String filter, Context context); + ManagementGroupAggregatedCostResultInner getByManagementGroup(String managementGroupId); /** * Provides the aggregate cost of a management group and all child management groups by specified billing period. * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup( - String managementGroupId, String billingPeriodName); + Response getForBillingPeriodByManagementGroupWithResponse( + String managementGroupId, String billingPeriodName, Context context); /** * Provides the aggregate cost of a management group and all child management groups by specified billing period. * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getForBillingPeriodByManagementGroupWithResponse( - String managementGroupId, String billingPeriodName, Context context); + ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup( + String managementGroupId, String billingPeriodName); } 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 e21a93426a857..a20eef23c506b 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 @@ -17,27 +17,27 @@ public interface BalancesClient { * later. * * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BalanceInner getByBillingAccount(String billingAccountId); + Response getByBillingAccountWithResponse(String billingAccountId, Context context); /** * Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or * later. * * @param billingAccountId BillingAccount ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billingAccountId. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingAccountWithResponse(String billingAccountId, Context context); + BalanceInner getByBillingAccount(String billingAccountId); /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only @@ -45,13 +45,15 @@ public interface BalancesClient { * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) - BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName); + Response getForBillingPeriodByBillingAccountWithResponse( + String billingAccountId, String billingPeriodName, Context context); /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only @@ -59,13 +61,11 @@ public interface BalancesClient { * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billing period and billingAccountId. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getForBillingPeriodByBillingAccountWithResponse( - String billingAccountId, String billingPeriodName, Context context); + BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName); } 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 031ef9c557caf..3428003b380e4 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 @@ -26,12 +26,12 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); @@ -49,13 +49,13 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); @@ -73,16 +73,17 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) - BudgetInner get(String scope, String budgetName); + Response getWithResponse(String scope, String budgetName, Context context); /** * Gets the budget for the scope by budget name. @@ -97,17 +98,16 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the budget for the scope by budget name. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, String budgetName, Context context); + BudgetInner get(String scope, String budgetName); /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of @@ -124,17 +124,19 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a budget resource. + * @return a budget resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters); + Response createOrUpdateWithResponse( + String scope, String budgetName, BudgetInner parameters, Context context); /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of @@ -151,19 +153,17 @@ public interface BudgetsClient { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a budget resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String scope, String budgetName, BudgetInner parameters, Context context); + BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters); /** * The operation to delete a budget. @@ -178,15 +178,17 @@ Response createOrUpdateWithResponse( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String scope, String budgetName); + Response deleteWithResponse(String scope, String budgetName, Context context); /** * The operation to delete a budget. @@ -201,15 +203,13 @@ Response createOrUpdateWithResponse( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String scope, String budgetName, Context context); + void delete(String scope, String budgetName); } 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 58df00d67d608..da231af908224 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 @@ -27,17 +27,27 @@ public interface ChargesClient { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. + * @param startDate Start date. + * @param endDate End date. + * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, + * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by + * properties/invoiceSectionId. + * @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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ChargesListResultInner list(String scope); + Response listWithResponse( + String scope, String startDate, String endDate, String filter, String apply, Context context); /** * Lists the charges based for the defined scope. @@ -54,25 +64,15 @@ public interface ChargesClient { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. - * @param startDate Start date. - * @param endDate End date. - * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, - * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by - * properties/invoiceSectionId. - * @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 charge summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse( - String scope, String startDate, String endDate, String filter, String apply, Context context); + ChargesListResultInner list(String scope); } 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 4a9bba8b64c61..1c418d6b439b8 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 @@ -17,25 +17,25 @@ public interface CreditsClient { * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a credit summary resource. + * @return a credit summary resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - CreditSummaryInner get(String billingAccountId, String billingProfileId); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); /** * The credit summary by billingAccountId and billingProfileId. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String billingAccountId, String billingProfileId, Context context); + CreditSummaryInner get(String billingAccountId, String billingProfileId); } 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 7591c8b7840b3..b9c7f11a7a63c 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 6c7db7249652f..43d2f2092bcd9 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 56f5b91e7340d..a6a9d0d633892 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 d8528c9abbd37..2572135f1224c 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 083b16f7e65c5..047677b93c8bb 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 @@ -7,11 +7,32 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner; import com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner; /** An instance of this class provides access to all the operations defined in PriceSheetsClient. */ public interface PriceSheetsClient { + /** + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + * + * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields + * are not included when returning price sheet. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the top N results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the price sheet for a subscription along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String expand, String skiptoken, Integer top, Context context); + /** * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * @@ -23,8 +44,10 @@ public interface PriceSheetsClient { PriceSheetResultInner get(); /** - * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only + * for May 1, 2014 or later. * + * @param billingPeriodName Billing Period Name. * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response @@ -35,10 +58,11 @@ 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 scope by subscriptionId and billing period along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String expand, String skiptoken, Integer top, Context context); + Response getByBillingPeriodWithResponse( + String billingPeriodName, String expand, String skiptoken, Integer top, Context context); /** * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only @@ -54,23 +78,59 @@ public interface PriceSheetsClient { PriceSheetResultInner getByBillingPeriod(String billingPeriodName); /** - * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only - * for May 1, 2014 or later. + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginDownloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields - * are not included when returning price sheet. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the top N results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a scope by subscriptionId and billing period. + * @return the {@link SyncPoller} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, OperationStatusInner> beginDownloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName, Context context); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByBillingPeriodWithResponse( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context); + OperationStatusInner downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + OperationStatusInner downloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationRecommendationDetailsClient.java index 042ad2b40fdd1..62160049c55f4 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,47 +20,55 @@ 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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ReservationRecommendationDetailsModelInner get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + Response getWithResponse( + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context); /** * 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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). - * @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 reservation recommendation details. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); + ReservationRecommendationDetailsModelInner get( + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); } 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 c713f5d4d2771..2cdb16d222eae 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 3d45b967b6e36..1cf9b761baabf 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 @@ -10,62 +10,91 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionInner; import com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner; +import java.math.BigDecimal; /** 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @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); + PagedIterable list( + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 2ffbf884bf393..b7bee6fe6ffd7 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 @@ -13,7 +13,11 @@ /** An instance of this class provides access to all the operations defined in ReservationsDetailsClient. */ public interface ReservationsDetailsClient { /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -21,13 +25,17 @@ 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); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -36,14 +44,18 @@ 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, Context context); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -52,14 +64,18 @@ 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( String reservationOrderId, String reservationId, String filter); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -69,31 +85,39 @@ 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( String reservationOrderId, String reservationId, String filter, Context context); /** - * Lists the reservations details for the defined scope and provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +133,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 40be069d1339d..31216e5c888e0 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 @@ -14,20 +14,24 @@ /** An instance of this class provides access to all the operations defined in ReservationsSummariesClient. */ public interface ReservationsSummariesClient { /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -37,14 +41,16 @@ 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, String filter, Context context); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -52,14 +58,16 @@ 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( String reservationOrderId, String reservationId, Datagrain grain); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -70,16 +78,18 @@ 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( String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +97,17 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +124,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 2266b2caca8cc..d3193b9e18aaf 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 @@ -23,13 +23,14 @@ public interface TagsClient { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. + * @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 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) - TagsResultInner get(String scope); + Response getWithResponse(String scope, Context context); /** * Get all available tag keys for the defined scope. @@ -42,12 +43,11 @@ public interface TagsClient { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. - * @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 all available tag keys for the defined scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String scope, Context context); + TagsResultInner get(String scope); } 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 e89c21afee289..d0f302be75b9b 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 @@ -17,6 +17,12 @@ public interface UsageDetailsClient { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -30,14 +36,14 @@ public interface UsageDetailsClient { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -46,6 +52,12 @@ public interface UsageDetailsClient { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -59,9 +71,9 @@ public interface UsageDetailsClient { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -79,7 +91,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 be4d23435c3bf..8775cba2ace84 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. */ @@ -41,6 +37,10 @@ public final class BalanceInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of BalanceInner class. */ + public BalanceInner() { + } + /** * Get the innerProperties property: The properties of the balance. * @@ -200,6 +200,15 @@ public Boolean priceHidden() { return this.innerProperties() == null ? null : this.innerProperties().priceHidden(); } + /** + * Get the overageRefund property: Overage Refunds. + * + * @return the overageRefund value. + */ + public BigDecimal overageRefund() { + return this.innerProperties() == null ? null : this.innerProperties().overageRefund(); + } + /** * Get the newPurchasesDetails property: List of new purchases. * 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 f0e15ad53cf24..a84290ad9a7d9 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. */ @@ -32,8 +28,7 @@ public final class BalanceProperties { private BigDecimal beginningBalance; /* - * The ending balance for the billing period (for open periods this will be - * updated daily). + * The ending balance for the billing period (for open periods this will be updated daily). */ @JsonProperty(value = "endingBalance", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal endingBalance; @@ -98,6 +93,12 @@ public final class BalanceProperties { @JsonProperty(value = "priceHidden", access = JsonProperty.Access.WRITE_ONLY) private Boolean priceHidden; + /* + * Overage Refunds + */ + @JsonProperty(value = "overageRefund", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal overageRefund; + /* * List of new purchases. */ @@ -110,6 +111,10 @@ public final class BalanceProperties { @JsonProperty(value = "adjustmentDetails", access = JsonProperty.Access.WRITE_ONLY) private List adjustmentDetails; + /** Creates an instance of BalanceProperties class. */ + public BalanceProperties() { + } + /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. * @@ -239,6 +244,15 @@ public Boolean priceHidden() { return this.priceHidden; } + /** + * Get the overageRefund property: Overage Refunds. + * + * @return the overageRefund value. + */ + public BigDecimal overageRefund() { + return this.overageRefund; + } + /** * Get the newPurchasesDetails property: List of new purchases. * 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 f8fea1a4e18b1..61217c1746377 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. */ @@ -31,13 +27,16 @@ public final class BudgetInner extends ProxyResource { private BudgetProperties innerProperties; /* - * eTag of the resource. To handle concurrent update scenario, this field - * will be used to determine whether the user is updating the latest - * version or not. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ @JsonProperty(value = "eTag") private String etag; + /** Creates an instance of BudgetInner class. */ + public BudgetInner() { + } + /** * Get the innerProperties property: 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 ef8131acd2876..198e9d2956c7d 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. */ @@ -37,19 +34,17 @@ public final class BudgetProperties { private BigDecimal amount; /* - * The time covered by a budget. Tracking of the amount will be reset based - * on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are - * only supported by WD customers + * The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, + * BillingQuarter, and BillingAnnual are only supported by WD customers */ @JsonProperty(value = "timeGrain", required = true) private TimeGrainType timeGrain; /* - * Has start and end date of the budget. The start date must be first of - * the month and should be less than the end date. Budget start date must - * be on or after June 1, 2017. Future start date should not be more than - * twelve months. Past start date should be selected within the timegrain - * period. There are no restrictions on the end date. + * Has start and end date of the budget. The start date must be first of the month and should be less than the end + * date. Budget start date must be on or after June 1, 2017. Future start date should not be more than twelve + * months. Past start date should be selected within the timegrain period. There are no restrictions on the end + * date. */ @JsonProperty(value = "timePeriod", required = true) private BudgetTimePeriod timePeriod; @@ -67,8 +62,7 @@ public final class BudgetProperties { private CurrentSpend currentSpend; /* - * Dictionary of notifications associated with the budget. Budget can have - * up to five notifications. + * Dictionary of notifications associated with the budget. Budget can have up to five notifications. */ @JsonProperty(value = "notifications") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -80,6 +74,10 @@ public final class BudgetProperties { @JsonProperty(value = "forecastSpend", access = JsonProperty.Access.WRITE_ONLY) private ForecastSpend forecastSpend; + /** Creates an instance of BudgetProperties class. */ + public BudgetProperties() { + } + /** * Get the category property: The category of the budget, whether the budget tracks cost or usage. * @@ -235,22 +233,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 +274,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 4675dd79f2cb1..6bf524f365f6d 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,23 +5,23 @@ 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 */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; + /** Creates an instance of ChargesListResultInner class. */ + public ChargesListResultInner() { + } + /** * Get the value property: 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 0ee648db2f115..e46cfe7f0749b 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,20 +6,14 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.Amount; import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.Reseller; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; /** A credit summary resource. */ @Fluent public final class CreditSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditSummaryInner.class); - /* * The properties of the credit summary. */ @@ -27,17 +21,15 @@ public final class CreditSummaryInner extends ProxyResource { private CreditSummaryProperties innerProperties; /* - * The etag for the resource. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ - @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY) + @JsonProperty(value = "eTag") private String etag; - /* - * Resource tags. - */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; + /** Creates an instance of CreditSummaryInner class. */ + public CreditSummaryInner() { + } /** * Get the innerProperties property: The properties of the credit summary. @@ -49,7 +41,8 @@ private CreditSummaryProperties innerProperties() { } /** - * Get the etag property: The etag for the resource. + * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. * * @return the etag value. */ @@ -58,12 +51,15 @@ public String etag() { } /** - * Get the tags property: Resource tags. + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. * - * @return the tags value. + * @param etag the etag value to set. + * @return the CreditSummaryInner object itself. */ - public Map tags() { - return this.tags; + public CreditSummaryInner withEtag(String etag) { + this.etag = etag; + return this; } /** @@ -129,6 +125,16 @@ public Reseller reseller() { return this.innerProperties() == null ? null : this.innerProperties().reseller(); } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.innerProperties() == null ? null : this.innerProperties().isEstimatedBalance(); + } + /** * Get the etag property: The eTag for the resource. * 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 cbe557ebe2bb5..82f107a97862d 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. */ @@ -59,12 +55,22 @@ public final class CreditSummaryProperties { @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) private Reseller reseller; + /* + * If true, the listed details are based on an estimation and it will be subjected to change. + */ + @JsonProperty(value = "isEstimatedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEstimatedBalance; + /* * The eTag for the resource. */ @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of CreditSummaryProperties class. */ + public CreditSummaryProperties() { + } + /** * Get the balanceSummary property: Summary of balances associated with this credit summary. * @@ -128,6 +134,16 @@ public Reseller reseller() { return this.reseller; } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.isEstimatedBalance; + } + /** * Get the etag property: The eTag for the resource. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/DownloadProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/DownloadProperties.java new file mode 100644 index 0000000000000..55ea8ff16e29c --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/DownloadProperties.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The properties of the price sheet download. */ +@Immutable +public final class DownloadProperties { + /* + * The link (url) to download the pricesheet. + */ + @JsonProperty(value = "downloadUrl", access = JsonProperty.Access.WRITE_ONLY) + private String downloadUrl; + + /* + * Download link validity. + */ + @JsonProperty(value = "validTill", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime validTill; + + /** Creates an instance of DownloadProperties class. */ + public DownloadProperties() { + } + + /** + * Get the downloadUrl property: The link (url) to download the pricesheet. + * + * @return the downloadUrl value. + */ + public String downloadUrl() { + return this.downloadUrl; + } + + /** + * Get the validTill property: Download link validity. + * + * @return the validTill value. + */ + public OffsetDateTime validTill() { + return this.validTill; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventProperties.java index c431a1c9e2bfd..c0eb0a0e5eb85 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. */ @@ -32,29 +28,25 @@ public final class EventProperties { private String description; /* - * The amount of new credit or commitment for NewCredit or SettleCharges - * event. + * The amount of new credit or commitment for NewCredit or SettleCharges event. */ @JsonProperty(value = "newCredit", access = JsonProperty.Access.WRITE_ONLY) private Amount newCredit; /* - * The amount of balance adjustment. The property is not available for - * ConsumptionCommitment lots. + * The amount of balance adjustment. The property is not available for ConsumptionCommitment lots. */ @JsonProperty(value = "adjustments", access = JsonProperty.Access.WRITE_ONLY) private Amount adjustments; /* - * The amount of expired credit or commitment for NewCredit or - * SettleCharges event. + * The amount of expired credit or commitment for NewCredit or SettleCharges event. */ @JsonProperty(value = "creditExpired", access = JsonProperty.Access.WRITE_ONLY) private Amount creditExpired; /* - * The amount of charges for events of type SettleCharges and - * PendingEligibleCharges. + * The amount of charges for events of type SettleCharges and PendingEligibleCharges. */ @JsonProperty(value = "charges", access = JsonProperty.Access.WRITE_ONLY) private Amount charges; @@ -72,24 +64,22 @@ public final class EventProperties { private EventType eventType; /* - * The number which uniquely identifies the invoice on which the event was - * billed. This will be empty for unbilled events. + * The number which uniquely identifies the invoice on which the event was billed. This will be empty for unbilled + * events. */ @JsonProperty(value = "invoiceNumber", access = JsonProperty.Access.WRITE_ONLY) private String invoiceNumber; /* - * The ID that uniquely identifies the billing profile for which the event - * happened. The property is only available for billing account of type - * MicrosoftCustomerAgreement. + * The ID that uniquely identifies the billing profile for which the event happened. The property is only available + * for billing account of type MicrosoftCustomerAgreement. */ @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileId; /* - * The display name of the billing profile for which the event happened. - * The property is only available for billing account of type - * MicrosoftCustomerAgreement. + * The display name of the billing profile for which the event happened. The property is only available for billing + * account of type MicrosoftCustomerAgreement. */ @JsonProperty(value = "billingProfileDisplayName", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileDisplayName; @@ -131,15 +121,13 @@ public final class EventProperties { private Reseller reseller; /* - * The amount of expired credit or commitment for NewCredit or - * SettleCharges event in billing currency. + * The amount of expired credit or commitment for NewCredit or SettleCharges event in billing currency. */ @JsonProperty(value = "creditExpiredInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate creditExpiredInBillingCurrency; /* - * The amount of new credit or commitment for NewCredit or SettleCharges - * event in billing currency. + * The amount of new credit or commitment for NewCredit or SettleCharges event in billing currency. */ @JsonProperty(value = "newCreditInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate newCreditInBillingCurrency; @@ -151,8 +139,7 @@ public final class EventProperties { private AmountWithExchangeRate adjustmentsInBillingCurrency; /* - * The amount of charges for events of type SettleCharges and - * PendingEligibleCharges in billing currency. + * The amount of charges for events of type SettleCharges and PendingEligibleCharges in billing currency. */ @JsonProperty(value = "chargesInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate chargesInBillingCurrency; @@ -163,12 +150,22 @@ public final class EventProperties { @JsonProperty(value = "closedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate closedBalanceInBillingCurrency; + /* + * If true, the listed details are based on an estimation and it will be subjected to change. + */ + @JsonProperty(value = "isEstimatedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEstimatedBalance; + /* * The eTag for the resource. */ @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of EventProperties class. */ + public EventProperties() { + } + /** * Get the transactionDate property: The date of the event. * @@ -385,6 +382,16 @@ public AmountWithExchangeRate closedBalanceInBillingCurrency() { return this.closedBalanceInBillingCurrency; } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.isEstimatedBalance; + } + /** * Get the etag property: The eTag for the resource. * 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 e031fc2d183d7..d7311cfae343b 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. */ @@ -27,13 +23,16 @@ public final class EventSummaryInner extends ProxyResource { private EventProperties innerProperties; /* - * eTag of the resource. To handle concurrent update scenario, this field - * will be used to determine whether the user is updating the latest - * version or not. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ @JsonProperty(value = "eTag") private String etag; + /** Creates an instance of EventSummaryInner class. */ + public EventSummaryInner() { + } + /** * Get the innerProperties property: The event properties. * @@ -284,6 +283,16 @@ public AmountWithExchangeRate closedBalanceInBillingCurrency() { return this.innerProperties() == null ? null : this.innerProperties().closedBalanceInBillingCurrency(); } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.innerProperties() == null ? null : this.innerProperties().isEstimatedBalance(); + } + /** * Get the etag property: The eTag for the resource. * 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 935660710f205..730db0858b8bd 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. */ @@ -48,8 +44,8 @@ public final class LegacyChargeSummaryProperties { /* * Marketplace Charges. */ - @JsonProperty(value = "marketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal marketplaceCharges; + @JsonProperty(value = "azureMarketplaceCharges", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal azureMarketplaceCharges; /* * Currency Code @@ -57,6 +53,10 @@ public final class LegacyChargeSummaryProperties { @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) private String currency; + /** Creates an instance of LegacyChargeSummaryProperties class. */ + public LegacyChargeSummaryProperties() { + } + /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. * @@ -103,12 +103,12 @@ public BigDecimal chargesBilledSeparately() { } /** - * Get the marketplaceCharges property: Marketplace Charges. + * Get the azureMarketplaceCharges property: Marketplace Charges. * - * @return the marketplaceCharges value. + * @return the azureMarketplaceCharges value. */ - public BigDecimal marketplaceCharges() { - return this.marketplaceCharges; + public BigDecimal azureMarketplaceCharges() { + return this.azureMarketplaceCharges; } /** 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 55ddcf621918a..151688e5e90b0 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 */ @@ -24,10 +20,9 @@ public final class LegacyReservationTransactionProperties { private OffsetDateTime eventDate; /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a + * single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM + * size and region for the reservations. */ @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) private String reservationOrderId; @@ -39,7 +34,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; @@ -87,8 +82,7 @@ public final class LegacyReservationTransactionProperties { private String purchasingSubscriptionName; /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. */ @JsonProperty(value = "armSkuName", access = JsonProperty.Access.WRITE_ONLY) private String armSkuName; @@ -124,8 +118,7 @@ public final class LegacyReservationTransactionProperties { private String departmentName; /* - * The cost center of this department if it is a department and a cost - * center is provided. + * The cost center of this department if it is a department and a cost center is provided. */ @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) private String costCenter; @@ -160,6 +153,10 @@ public final class LegacyReservationTransactionProperties { @JsonProperty(value = "overage", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal overage; + /** Creates an instance of LegacyReservationTransactionProperties class. */ + public LegacyReservationTransactionProperties() { + } + /** * Get the eventDate property: The date of the transaction. * @@ -190,7 +187,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 39b1dfa8f8120..ac9e536b57496 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. */ @@ -86,31 +82,27 @@ public final class LegacyUsageDetailProperties { private OffsetDateTime date; /* - * Product name for the consumed service or purchase. Not available for - * Marketplace. + * Product name for the consumed service or purchase. Not available for Marketplace. */ @JsonProperty(value = "product", access = JsonProperty.Access.WRITE_ONLY) private String product; /* - * Part Number of the service used. Can be used to join with the price - * sheet. Not available for marketplace. + * Part Number of the service used. Can be used to join with the price sheet. Not available for marketplace. */ @JsonProperty(value = "partNumber", access = JsonProperty.Access.WRITE_ONLY) private String partNumber; /* - * The meter id (GUID). Not available for marketplace. For reserved - * instance this represents the primary meter for which the reservation was - * purchased. For the actual VM Size for which the reservation is purchased - * see productOrderName. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for + * which the reservation was purchased. For the actual VM Size for which the reservation is purchased see + * productOrderName. */ @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) private UUID meterId; /* - * The details about the meter. By default this is not populated, unless - * it's specified in $expand. + * The details about the meter. By default this is not populated, unless it's specified in $expand. */ @JsonProperty(value = "meterDetails", access = JsonProperty.Access.WRITE_ONLY) private MeterDetailsResponse meterDetails; @@ -134,8 +126,7 @@ public final class LegacyUsageDetailProperties { private BigDecimal cost; /* - * Unit Price is the price applicable to you. (your EA or other contract - * price). + * Unit Price is the price applicable to you. (your EA or other contract price). */ @JsonProperty(value = "unitPrice", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal unitPrice; @@ -153,9 +144,8 @@ public final class LegacyUsageDetailProperties { private String resourceLocation; /* - * Consumed service name. Name of the azure resource provider that emits - * the usage or was purchased. This value is not provided for marketplace - * usage. + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is + * not provided for marketplace usage. */ @JsonProperty(value = "consumedService", access = JsonProperty.Access.WRITE_ONLY) private String consumedService; @@ -185,10 +175,9 @@ public final class LegacyUsageDetailProperties { private String serviceInfo2; /* - * Additional details of this usage item. By default this is not populated, - * unless it's specified in $expand. Use this field to get usage line item - * specific details such as the actual VM Size (ServiceType) or the ratio - * in which the reservation discount is applied. + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. Use + * this field to get usage line item specific details such as the actual VM Size (ServiceType) or the ratio in + * which the reservation discount is applied. */ @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) private String additionalInfo; @@ -200,8 +189,7 @@ public final class LegacyUsageDetailProperties { private String invoiceSection; /* - * The cost center of this department if it is a department and a cost - * center is provided. + * The cost center of this department if it is a department and a cost center is provided. */ @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) private String costCenter; @@ -213,16 +201,14 @@ public final class LegacyUsageDetailProperties { private String resourceGroup; /* - * ARM resource id of the reservation. Only applies to records relevant to - * reservations. + * ARM resource id of the reservation. Only applies to records relevant to reservations. */ @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) private String reservationId; /* - * User provided display name of the reservation. Last known name for a - * particular day is populated in the daily data. Only applies to records - * relevant to reservations. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily + * data. Only applies to records relevant to reservations. */ @JsonProperty(value = "reservationName", access = JsonProperty.Access.WRITE_ONLY) private String reservationName; @@ -252,8 +238,8 @@ public final class LegacyUsageDetailProperties { private Boolean isAzureCreditEligible; /* - * Term (in months). 1 month for monthly recurring purchase. 12 months for - * a 1 year reservation. 36 months for a 3 year reservation. + * Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year reservation. 36 months for a 3 + * year reservation. */ @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) private String term; @@ -277,16 +263,14 @@ public final class LegacyUsageDetailProperties { private String planName; /* - * Indicates a charge represents credits, usage, a Marketplace purchase, a - * reservation fee, or a refund. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. */ @JsonProperty(value = "chargeType", access = JsonProperty.Access.WRITE_ONLY) private String chargeType; /* - * Indicates how frequently this charge will occur. OneTime for purchases - * which only happen once, Monthly for fees which recur every month, and - * UsageBased for charges based on how much a service is used. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees + * which recur every month, and UsageBased for charges based on how much a service is used. */ @JsonProperty(value = "frequency", access = JsonProperty.Access.WRITE_ONLY) private String frequency; @@ -297,12 +281,28 @@ 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. */ @JsonProperty(value = "pricingModel", access = JsonProperty.Access.WRITE_ONLY) private PricingModelType pricingModel; + /** Creates an instance of LegacyUsageDetailProperties class. */ + public LegacyUsageDetailProperties() { + } + /** * Get the billingAccountId property: Billing Account identifier. * @@ -704,6 +704,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 6849ba86cdac2..45c8f7cd2c574 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. */ @@ -51,8 +47,8 @@ public final class LotProperties { private OffsetDateTime expirationDate; /* - * The po number of the invoice on which the lot was added. This property - * is not available for ConsumptionCommitment lots. + * The po number of the invoice on which the lot was added. This property is not available for + * ConsumptionCommitment lots. */ @JsonProperty(value = "poNumber", access = JsonProperty.Access.WRITE_ONLY) private String poNumber; @@ -99,12 +95,22 @@ public final class LotProperties { @JsonProperty(value = "reseller", access = JsonProperty.Access.WRITE_ONLY) private Reseller reseller; + /* + * If true, the listed details are based on an estimation and it will be subjected to change. + */ + @JsonProperty(value = "isEstimatedBalance", access = JsonProperty.Access.WRITE_ONLY) + private Boolean isEstimatedBalance; + /* * The eTag for the resource. */ @JsonProperty(value = "eTag", access = JsonProperty.Access.WRITE_ONLY) private String etag; + /** Creates an instance of LotProperties class. */ + public LotProperties() { + } + /** * Get the originalAmount property: The original amount of a lot. * @@ -223,6 +229,16 @@ public Reseller reseller() { return this.reseller; } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.isEstimatedBalance; + } + /** * Get the etag property: The eTag for the resource. * 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 66ba7de656caf..c8ac84f96a280 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. */ @@ -28,13 +24,16 @@ public final class LotSummaryInner extends ProxyResource { private LotProperties innerProperties; /* - * eTag of the resource. To handle concurrent update scenario, this field - * will be used to determine whether the user is updating the latest - * version or not. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ @JsonProperty(value = "eTag") private String etag; + /** Creates an instance of LotSummaryInner class. */ + public LotSummaryInner() { + } + /** * Get the innerProperties property: The lot properties. * @@ -184,6 +183,16 @@ public Reseller reseller() { return this.innerProperties() == null ? null : this.innerProperties().reseller(); } + /** + * Get the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + public Boolean isEstimatedBalance() { + return this.innerProperties() == null ? null : this.innerProperties().isEstimatedBalance(); + } + /** * Get the etag property: The eTag for the resource. * 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 de916d475acc9..fbd40e92b7e86 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,11 +13,8 @@ /** 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. + * The id of the billing period resource that the aggregated cost belongs to. */ @JsonProperty(value = "billingPeriodId", access = JsonProperty.Access.WRITE_ONLY) private String billingPeriodId; @@ -67,19 +62,21 @@ public final class ManagementGroupAggregatedCostProperties { private List children; /* - * List of subscription Guids included in the calculation of aggregated - * cost + * List of subscription Guids included in the calculation of aggregated cost */ @JsonProperty(value = "includedSubscriptions") private List includedSubscriptions; /* - * List of subscription Guids excluded from the calculation of aggregated - * cost + * List of subscription Guids excluded from the calculation of aggregated cost */ @JsonProperty(value = "excludedSubscriptions") private List excludedSubscriptions; + /** Creates an instance of ManagementGroupAggregatedCostProperties class. */ + public ManagementGroupAggregatedCostProperties() { + } + /** * Get the billingPeriodId property: 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 dfe72201c6f30..f0a0972b22ec6 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. */ @@ -39,6 +35,10 @@ public final class ManagementGroupAggregatedCostResultInner extends ProxyResourc @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ManagementGroupAggregatedCostResultInner class. */ + public ManagementGroupAggregatedCostResultInner() { + } + /** * Get the innerProperties property: 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 659cbacda58b6..ab8e7318f6312 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceInner.java @@ -4,10 +4,8 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; +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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -16,10 +14,8 @@ import java.util.UUID; /** A marketplace resource. */ -@Fluent +@Immutable public final class MarketplaceInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(MarketplaceInner.class); - /* * The properties of the marketplace usage detail. */ @@ -39,6 +35,10 @@ public final class MarketplaceInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of MarketplaceInner class. */ + public MarketplaceInner() { + } + /** * Get the innerProperties property: 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 006420b0220af..e775e13ae3722 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. */ @@ -144,15 +140,13 @@ public final class MarketplaceProperties { private String consumedService; /* - * The cost center of this department if it is a department and a - * costcenter exists + * The cost center of this department if it is a department and a costcenter exists */ @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) private String costCenter; /* - * Additional details of this usage item. By default this is not populated, - * unless it's specified in $expand. + * Additional details of this usage item. By default this is not populated, unless it's specified in $expand. */ @JsonProperty(value = "additionalProperties", access = JsonProperty.Access.WRITE_ONLY) private String additionalProperties; @@ -175,6 +169,10 @@ public final class MarketplaceProperties { @JsonProperty(value = "isRecurringCharge", access = JsonProperty.Access.WRITE_ONLY) private Boolean isRecurringCharge; + /** Creates an instance of MarketplaceProperties class. */ + public MarketplaceProperties() { + } + /** * Get the billingPeriodId property: 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 9a5a2f9e026a6..246d330d7a3f0 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. */ @@ -81,6 +77,16 @@ public final class ModernChargeSummaryProperties { @JsonProperty(value = "isInvoiced", access = JsonProperty.Access.WRITE_ONLY) private Boolean isInvoiced; + /* + * Subscription guid. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private String subscriptionId; + + /** Creates an instance of ModernChargeSummaryProperties class. */ + public ModernChargeSummaryProperties() { + } + /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. * @@ -180,6 +186,15 @@ public Boolean isInvoiced() { return this.isInvoiced; } + /** + * Get the subscriptionId property: Subscription guid. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + /** * Validates the instance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java index 636c1f94bcf5a..bcb2516d6a3f9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java @@ -4,26 +4,27 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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; import java.util.UUID; /** Modern Reservation transaction resource. */ -@Fluent +@Immutable public final class ModernReservationTransactionInner extends ReservationTransactionResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationTransactionInner.class); - /* * The properties of a modern reservation transaction. */ @JsonProperty(value = "properties", required = true) private ModernReservationTransactionProperties innerProperties = new ModernReservationTransactionProperties(); + /** Creates an instance of ModernReservationTransactionInner class. */ + public ModernReservationTransactionInner() { + } + /** * Get the innerProperties property: The properties of a modern reservation transaction. * @@ -107,7 +108,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 +226,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 +234,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 fb749b85a5581..cb87dba75c37e 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. */ @@ -24,8 +20,7 @@ public final class ModernReservationTransactionProperties { private BigDecimal amount; /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. */ @JsonProperty(value = "armSkuName", access = JsonProperty.Access.WRITE_ONLY) private String armSkuName; @@ -67,7 +62,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; @@ -121,10 +116,9 @@ public final class ModernReservationTransactionProperties { private String region; /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a + * single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM + * size and region for the reservations. */ @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) private String reservationOrderId; @@ -141,6 +135,10 @@ public final class ModernReservationTransactionProperties { @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) private String term; + /** Creates an instance of ModernReservationTransactionProperties class. */ + public ModernReservationTransactionProperties() { + } + /** * Get the amount property: The charge of the transaction. * @@ -215,7 +213,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 00c64480a2cdc..f08e2c01cacad 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. */ @@ -55,18 +51,16 @@ public final class ModernUsageDetailProperties { private OffsetDateTime billingPeriodEndDate; /* - * Identifier for the billing profile that groups costs across invoices in - * the a singular billing currency across across the customers who have - * onboarded the Microsoft customer agreement and the customers in CSP who - * have made entitlement purchases like SaaS, Marketplace, RI, etc. + * Identifier for the billing profile that groups costs across invoices in the a singular billing currency across + * across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made + * entitlement purchases like SaaS, Marketplace, RI, etc. */ @JsonProperty(value = "billingProfileId", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileId; /* - * Name of the billing profile that groups costs across invoices in the a - * singular billing currency across across the customers who have onboarded - * the Microsoft customer agreement and the customers in CSP who have made + * Name of the billing profile that groups costs across invoices in the a singular billing currency across across + * the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made * entitlement purchases like SaaS, Marketplace, RI, etc. */ @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) @@ -91,17 +85,16 @@ public final class ModernUsageDetailProperties { private OffsetDateTime date; /* - * Name of the product that has accrued charges by consumption or purchase - * as listed in the invoice. Not available for Marketplace. + * Name of the product that has accrued charges by consumption or purchase as listed in the invoice. Not available + * for Marketplace. */ @JsonProperty(value = "product", access = JsonProperty.Access.WRITE_ONLY) private String product; /* - * The meter id (GUID). Not available for marketplace. For reserved - * instance this represents the primary meter for which the reservation was - * purchased. For the actual VM Size for which the reservation is purchased - * see productOrderName. + * The meter id (GUID). Not available for marketplace. For reserved instance this represents the primary meter for + * which the reservation was purchased. For the actual VM Size for which the reservation is purchased see + * productOrderName. */ @JsonProperty(value = "meterId", access = JsonProperty.Access.WRITE_ONLY) private UUID meterId; @@ -113,8 +106,7 @@ public final class ModernUsageDetailProperties { private String meterName; /* - * Identifies the location of the datacenter for certain services that are - * priced based on datacenter location. + * Identifies the location of the datacenter for certain services that are priced based on datacenter location. */ @JsonProperty(value = "meterRegion", access = JsonProperty.Access.WRITE_ONLY) private String meterRegion; @@ -126,29 +118,25 @@ public final class ModernUsageDetailProperties { private String meterCategory; /* - * Defines the type or sub-category of Azure service that can affect the - * rate. + * Defines the type or sub-category of Azure service that can affect the rate. */ @JsonProperty(value = "meterSubCategory", access = JsonProperty.Access.WRITE_ONLY) private String meterSubCategory; /* - * List the service family for the product purchased or charged (Example: - * Storage ; Compute). + * List the service family for the product purchased or charged (Example: Storage ; Compute). */ @JsonProperty(value = "serviceFamily", access = JsonProperty.Access.WRITE_ONLY) private String serviceFamily; /* - * Measure the quantity purchased or consumed.The amount of the meter used - * during the billing period. + * Measure the quantity purchased or consumed.The amount of the meter used during the billing period. */ @JsonProperty(value = "quantity", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal quantity; /* - * Identifies the Unit that the service is charged in. For example, GB, - * hours, 10,000 s. + * Identifies the Unit that the service is charged in. For example, GB, hours, 10,000 s. */ @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) private String unitOfMeasure; @@ -166,8 +154,7 @@ public final class ModernUsageDetailProperties { private BigDecimal costInUsd; /* - * Unit Price is the price applicable to you. (your EA or other contract - * price). + * Unit Price is the price applicable to you. (your EA or other contract price). */ @JsonProperty(value = "unitPrice", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal unitPrice; @@ -185,9 +172,8 @@ public final class ModernUsageDetailProperties { private String resourceLocation; /* - * Consumed service name. Name of the azure resource provider that emits - * the usage or was purchased. This value is not provided for marketplace - * usage. + * Consumed service name. Name of the azure resource provider that emits the usage or was purchased. This value is + * not provided for marketplace usage. */ @JsonProperty(value = "consumedService", access = JsonProperty.Access.WRITE_ONLY) private String consumedService; @@ -205,60 +191,54 @@ public final class ModernUsageDetailProperties { private String serviceInfo2; /* - * Additional details of this usage item. Use this field to get usage line - * item specific details such as the actual VM Size (ServiceType) or the - * ratio in which the reservation discount is applied. + * Additional details of this usage item. Use this field to get usage line item specific details such as the actual + * VM Size (ServiceType) or the ratio in which the reservation discount is applied. */ @JsonProperty(value = "additionalInfo", access = JsonProperty.Access.WRITE_ONLY) private String additionalInfo; /* - * Identifier of the project that is being charged in the invoice. Not - * applicable for Microsoft Customer Agreements onboarded by partners. + * Identifier of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements + * onboarded by partners. */ @JsonProperty(value = "invoiceSectionId", access = JsonProperty.Access.WRITE_ONLY) private String invoiceSectionId; /* - * Name of the project that is being charged in the invoice. Not applicable - * for Microsoft Customer Agreements onboarded by partners. + * Name of the project that is being charged in the invoice. Not applicable for Microsoft Customer Agreements + * onboarded by partners. */ @JsonProperty(value = "invoiceSectionName", access = JsonProperty.Access.WRITE_ONLY) private String invoiceSectionName; /* - * The cost center of this department if it is a department and a cost - * center is provided. + * The cost center of this department if it is a department and a cost center is provided. */ @JsonProperty(value = "costCenter", access = JsonProperty.Access.WRITE_ONLY) private String costCenter; /* - * Name of the Azure resource group used for cohesive lifecycle management - * of resources. + * Name of the Azure resource group used for cohesive lifecycle management of resources. */ @JsonProperty(value = "resourceGroup", access = JsonProperty.Access.WRITE_ONLY) private String resourceGroup; /* - * ARM resource id of the reservation. Only applies to records relevant to - * reservations. + * ARM resource id of the reservation. Only applies to records relevant to reservations. */ @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) private String reservationId; /* - * User provided display name of the reservation. Last known name for a - * particular day is populated in the daily data. Only applies to records - * relevant to reservations. + * User provided display name of the reservation. Last known name for a particular day is populated in the daily + * data. Only applies to records relevant to reservations. */ @JsonProperty(value = "reservationName", access = JsonProperty.Access.WRITE_ONLY) private String reservationName; /* - * The identifier for the asset or Azure plan name that the subscription - * belongs to. For example: Azure Plan. For reservations this is the - * Reservation Order ID. + * The identifier for the asset or Azure plan name that the subscription belongs to. For example: Azure Plan. For + * reservations this is the Reservation Order ID. */ @JsonProperty(value = "productOrderId", access = JsonProperty.Access.WRITE_ONLY) private String productOrderId; @@ -276,40 +256,34 @@ public final class ModernUsageDetailProperties { private Boolean isAzureCreditEligible; /* - * Term (in months). Displays the term for the validity of the offer. For - * example. In case of reserved instances it displays 12 months for yearly - * term of reserved instance. For one time purchases or recurring - * purchases, the terms displays 1 month; This is not applicable for Azure - * consumption. + * Term (in months). Displays the term for the validity of the offer. For example. In case of reserved instances it + * displays 12 months for yearly term of reserved instance. For one time purchases or recurring purchases, the + * terms displays 1 month; This is not applicable for Azure consumption. */ @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) private String term; /* - * Name of the publisher of the service including Microsoft or Third Party - * publishers. + * Name of the publisher of the service including Microsoft or Third Party publishers. */ @JsonProperty(value = "publisherName", access = JsonProperty.Access.WRITE_ONLY) private String publisherName; /* - * Type of publisher that identifies if the publisher is first party, third - * party reseller or third party agency. + * Type of publisher that identifies if the publisher is first party, third party reseller or third party agency. */ @JsonProperty(value = "publisherType", access = JsonProperty.Access.WRITE_ONLY) private String publisherType; /* - * Indicates a charge represents credits, usage, a Marketplace purchase, a - * reservation fee, or a refund. + * Indicates a charge represents credits, usage, a Marketplace purchase, a reservation fee, or a refund. */ @JsonProperty(value = "chargeType", access = JsonProperty.Access.WRITE_ONLY) private String chargeType; /* - * Indicates how frequently this charge will occur. OneTime for purchases - * which only happen once, Monthly for fees which recur every month, and - * UsageBased for charges based on how much a service is used. + * Indicates how frequently this charge will occur. OneTime for purchases which only happen once, Monthly for fees + * which recur every month, and UsageBased for charges based on how much a service is used. */ @JsonProperty(value = "frequency", access = JsonProperty.Access.WRITE_ONLY) private String frequency; @@ -321,22 +295,19 @@ public final class ModernUsageDetailProperties { private BigDecimal costInBillingCurrency; /* - * ExtendedCost or blended cost before tax in pricing currency to correlate - * with prices. + * ExtendedCost or blended cost before tax in pricing currency to correlate with prices. */ @JsonProperty(value = "costInPricingCurrency", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal costInPricingCurrency; /* - * Exchange rate used in conversion from pricing currency to billing - * currency. + * Exchange rate used in conversion from pricing currency to billing currency. */ @JsonProperty(value = "exchangeRate", access = JsonProperty.Access.WRITE_ONLY) private String exchangeRate; /* - * Date on which exchange rate used in conversion from pricing currency to - * billing currency. + * Date on which exchange rate used in conversion from pricing currency to billing currency. */ @JsonProperty(value = "exchangeRateDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime exchangeRateDate; @@ -348,8 +319,8 @@ public final class ModernUsageDetailProperties { private String invoiceId; /* - * Reference to an original invoice there is a refund (negative cost). This - * is populated only when there is a refund. + * Reference to an original invoice there is a refund (negative cost). This is populated only when there is a + * refund. */ @JsonProperty(value = "previousInvoiceId", access = JsonProperty.Access.WRITE_ONLY) private String previousInvoiceId; @@ -361,9 +332,8 @@ public final class ModernUsageDetailProperties { private String pricingCurrencyCode; /* - * Identifier for the product that has accrued charges by consumption or - * purchase . This is the concatenated key of productId and SkuId in - * partner center. + * Identifier for the product that has accrued charges by consumption or purchase . This is the concatenated key of + * productId and SkuId in partner center. */ @JsonProperty(value = "productIdentifier", access = JsonProperty.Access.WRITE_ONLY) private String productIdentifier; @@ -375,16 +345,15 @@ public final class ModernUsageDetailProperties { private String resourceLocationNormalized; /* - * Start date for the rating period when the service usage was rated for - * charges. The prices for Azure services are determined for the rating - * period. + * Start date for the rating period when the service usage was rated for charges. The prices for Azure services are + * determined for the rating period. */ @JsonProperty(value = "servicePeriodStartDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime servicePeriodStartDate; /* - * End date for the period when the service usage was rated for charges. - * The prices for Azure services are determined based on the rating period. + * End date for the period when the service usage was rated for charges. The prices for Azure services are + * determined based on the rating period. */ @JsonProperty(value = "servicePeriodEndDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime servicePeriodEndDate; @@ -456,8 +425,7 @@ public final class ModernUsageDetailProperties { private BigDecimal paygCostInUsd; /* - * Rate of discount applied if there is a partner earned credit (PEC) based - * on partner admin link access. + * Rate of discount applied if there is a partner earned credit (PEC) based on partner admin link access. */ @JsonProperty(value = "partnerEarnedCreditRate", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal partnerEarnedCreditRate; @@ -487,8 +455,7 @@ public final class ModernUsageDetailProperties { private String benefitName; /* - * Identifier for Product Category or Line Of Business, Ex - Azure, - * Microsoft 365, AWS e.t.c + * Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS e.t.c */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; @@ -499,6 +466,10 @@ public final class ModernUsageDetailProperties { @JsonProperty(value = "costAllocationRuleName", access = JsonProperty.Access.WRITE_ONLY) private String costAllocationRuleName; + /** Creates an instance of ModernUsageDetailProperties class. */ + public ModernUsageDetailProperties() { + } + /** * Get the billingAccountId property: 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 fe76c6fdfa548..2b081521a8106 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. */ @@ -33,6 +29,10 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /** Creates an instance of OperationInner class. */ + public OperationInner() { + } + /** * Get the id property: Operation Id. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationStatusInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationStatusInner.java new file mode 100644 index 0000000000000..be89e2f4c49ec --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationStatusInner.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.resourcemanager.consumption.models.OperationStatusType; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** The status of the long running operation. */ +@Fluent +public final class OperationStatusInner { + /* + * The status of the long running operation. + */ + @JsonProperty(value = "status") + private OperationStatusType status; + + /* + * The properties of the resource generated. + */ + @JsonProperty(value = "properties") + private DownloadProperties innerProperties; + + /** Creates an instance of OperationStatusInner class. */ + public OperationStatusInner() { + } + + /** + * Get the status property: The status of the long running operation. + * + * @return the status value. + */ + public OperationStatusType status() { + return this.status; + } + + /** + * Set the status property: The status of the long running operation. + * + * @param status the status value to set. + * @return the OperationStatusInner object itself. + */ + public OperationStatusInner withStatus(OperationStatusType status) { + this.status = status; + return this; + } + + /** + * Get the innerProperties property: The properties of the resource generated. + * + * @return the innerProperties value. + */ + private DownloadProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the downloadUrl property: The link (url) to download the pricesheet. + * + * @return the downloadUrl value. + */ + public String downloadUrl() { + return this.innerProperties() == null ? null : this.innerProperties().downloadUrl(); + } + + /** + * Get the validTill property: Download link validity. + * + * @return the validTill value. + */ + public OffsetDateTime validTill() { + return this.innerProperties() == null ? null : this.innerProperties().validTill(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetModel.java index 0e4aa629a411c..4db63a05371f8 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 */ @@ -35,6 +31,10 @@ public final class PriceSheetModel { @JsonProperty(value = "download", access = JsonProperty.Access.WRITE_ONLY) private MeterDetails download; + /** Creates an instance of PriceSheetModel class. */ + public PriceSheetModel() { + } + /** * Get the pricesheets property: 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 7d19b3f74d32d..c4613e3bc626a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java @@ -4,25 +4,20 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; +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.MeterDetails; import com.azure.resourcemanager.consumption.models.PriceSheetProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; import java.util.Map; /** An pricesheet resource. */ -@Fluent +@Immutable 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 + * price sheet result. It contains the pricesheet associated with billing period */ @JsonProperty(value = "properties") private PriceSheetModel innerProperties; @@ -40,6 +35,10 @@ public final class PriceSheetResultInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of PriceSheetResultInner class. */ + public PriceSheetResultInner() { + } + /** * Get the innerProperties property: 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 ba58947769d81..fdf3c65464a40 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java @@ -4,10 +4,8 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; +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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -15,10 +13,8 @@ import java.util.Map; /** reservation detail resource. */ -@Fluent +@Immutable public final class ReservationDetailInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailInner.class); - /* * The properties of the reservation detail. */ @@ -38,6 +34,10 @@ public final class ReservationDetailInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ReservationDetailInner class. */ + public ReservationDetailInner() { + } + /** * Get the innerProperties property: 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 99fe617af2d03..56bbaffb1e61b 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,13 +12,10 @@ /** The properties of the reservation detail. */ @Immutable public final class ReservationDetailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailProperties.class); - /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a + * single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM + * size and region for the reservations. */ @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) private String reservationOrderId; @@ -38,25 +33,22 @@ public final class ReservationDetailProperties { private String instanceFlexibilityGroup; /* - * The reservation ID is the identifier of a reservation within a - * reservation order. Each reservation is the grouping for applying the - * benefit scope and also specifies the number of instances to which the - * reservation benefit can be applied to. + * The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the + * grouping for applying the benefit scope and also specifies the number of instances to which the reservation + * benefit can be applied to. */ @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) private String reservationId; /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. */ @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) private String skuName; /* - * This is the total hours reserved for the day. E.g. if reservation for 1 - * instance was made on 1 PM, this will be 11 hours for that day and 24 - * hours from subsequent days. + * This is the total hours reserved for the day. E.g. if reservation for 1 instance was made on 1 PM, this will be + * 11 hours for that day and 24 hours from subsequent days. */ @JsonProperty(value = "reservedHours", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal reservedHours; @@ -74,15 +66,13 @@ public final class ReservationDetailProperties { private BigDecimal usedHours; /* - * This identifier is the name of the resource or the fully qualified - * Resource ID. + * This identifier is the name of the resource or the fully qualified Resource ID. */ @JsonProperty(value = "instanceId", access = JsonProperty.Access.WRITE_ONLY) private String instanceId; /* - * This is the total count of instances that are reserved for the - * reservationId. + * This is the total count of instances that are reserved for the reservationId. */ @JsonProperty(value = "totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal totalReservedQuantity; @@ -93,6 +83,10 @@ public final class ReservationDetailProperties { @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) private String kind; + /** Creates an instance of ReservationDetailProperties class. */ + public ReservationDetailProperties() { + } + /** * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The 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 68e957a682f69..7a852a01876ea 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. */ @@ -51,6 +47,10 @@ public final class ReservationRecommendationDetailsModelInner extends ProxyResou @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ReservationRecommendationDetailsModelInner class. */ + public ReservationRecommendationDetailsModelInner() { + } + /** * Get the location property: 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 adeb2dae589ca..8574b3cc96156 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 */ @@ -53,6 +49,10 @@ public final class ReservationRecommendationDetailsProperties { @JsonProperty(value = "usage", access = JsonProperty.Access.WRITE_ONLY) private ReservationRecommendationDetailsUsageProperties usage; + /** Creates an instance of ReservationRecommendationDetailsProperties class. */ + public ReservationRecommendationDetailsProperties() { + } + /** * Get the currency property: 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 45566e5e40127..afb943323e088 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. */ @@ -57,6 +53,10 @@ public class ReservationRecommendationInner extends ProxyResource { @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private String sku; + /** Creates an instance of ReservationRecommendationInner class. */ + public ReservationRecommendationInner() { + } + /** * Get the etag property: 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 7b913e6e0ac36..555b5dc018de5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java @@ -4,10 +4,8 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; +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.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; @@ -15,10 +13,8 @@ import java.util.Map; /** reservation summary resource. */ -@Fluent +@Immutable public final class ReservationSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryInner.class); - /* * The properties of the reservation summary. */ @@ -38,6 +34,10 @@ public final class ReservationSummaryInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of ReservationSummaryInner class. */ + public ReservationSummaryInner() { + } + /** * Get the innerProperties property: 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 2bd838de647ed..16c83b8d9f6c5 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,44 +12,37 @@ /** The properties of the reservation summary. */ @Immutable public final class ReservationSummaryProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryProperties.class); - /* - * The reservation order ID is the identifier for a reservation purchase. - * Each reservation order ID represents a single purchase transaction. A - * reservation order contains reservations. The reservation order specifies - * the VM size and region for the reservations. + * The reservation order ID is the identifier for a reservation purchase. Each reservation order ID represents a + * single purchase transaction. A reservation order contains reservations. The reservation order specifies the VM + * size and region for the reservations. */ @JsonProperty(value = "reservationOrderId", access = JsonProperty.Access.WRITE_ONLY) private String reservationOrderId; /* - * The reservation ID is the identifier of a reservation within a - * reservation order. Each reservation is the grouping for applying the - * benefit scope and also specifies the number of instances to which the - * reservation benefit can be applied to. + * The reservation ID is the identifier of a reservation within a reservation order. Each reservation is the + * grouping for applying the benefit scope and also specifies the number of instances to which the reservation + * benefit can be applied to. */ @JsonProperty(value = "reservationId", access = JsonProperty.Access.WRITE_ONLY) private String reservationId; /* - * This is the ARM Sku name. It can be used to join with the serviceType - * field in additional info in usage records. + * This is the ARM Sku name. It can be used to join with the serviceType field in additional info in usage records. */ @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) private String skuName; /* - * This is the total hours reserved. E.g. if reservation for 1 instance was - * made on 1 PM, this will be 11 hours for that day and 24 hours from - * subsequent days + * This is the total hours reserved. E.g. if reservation for 1 instance was made on 1 PM, this will be 11 hours for + * that day and 24 hours from subsequent days */ @JsonProperty(value = "reservedHours", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal reservedHours; /* - * Data corresponding to the utilization record. If the grain of data is - * monthly, it will be first day of month. + * Data corresponding to the utilization record. If the grain of data is monthly, it will be first day of month. */ @JsonProperty(value = "usageDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime usageDate; @@ -63,24 +54,21 @@ public final class ReservationSummaryProperties { private BigDecimal usedHours; /* - * This is the minimum hourly utilization in the usage time (day or month). - * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 - * and 5, utilization was 10%, this field will return 10% for that day + * This is the minimum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to + * 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this field will return 10% for that day */ @JsonProperty(value = "minUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal minUtilizationPercentage; /* - * This is average utilization for the entire time range. (day or month - * depending on the grain) + * This is average utilization for the entire time range. (day or month depending on the grain) */ @JsonProperty(value = "avgUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal avgUtilizationPercentage; /* - * This is the maximum hourly utilization in the usage time (day or month). - * E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 - * and 5, utilization was 100%, this field will return 100% for that day. + * This is the maximum hourly utilization in the usage time (day or month). E.g. if usage record corresponds to + * 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this field will return 100% for that day. */ @JsonProperty(value = "maxUtilizationPercentage", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal maxUtilizationPercentage; @@ -104,8 +92,7 @@ public final class ReservationSummaryProperties { private BigDecimal remainingQuantity; /* - * This is the total count of instances that are reserved for the - * reservationId. + * This is the total count of instances that are reserved for the reservationId. */ @JsonProperty(value = "totalReservedQuantity", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal totalReservedQuantity; @@ -122,6 +109,10 @@ public final class ReservationSummaryProperties { @JsonProperty(value = "utilizedPercentage", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal utilizedPercentage; + /** Creates an instance of ReservationSummaryProperties class. */ + public ReservationSummaryProperties() { + } + /** * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The 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 f09a430c58bf4..f89084009e044 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java @@ -4,26 +4,26 @@ package com.azure.resourcemanager.consumption.fluent.models; -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.annotation.Immutable; 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; import java.util.UUID; /** Reservation transaction resource. */ -@Fluent +@Immutable public class ReservationTransactionInner extends ReservationTransactionResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationTransactionInner.class); - /* * The properties of a legacy reservation transaction. */ @JsonProperty(value = "properties") private LegacyReservationTransactionProperties innerProperties; + /** Creates an instance of ReservationTransactionInner class. */ + public ReservationTransactionInner() { + } + /** * Get the innerProperties property: The properties of a legacy reservation transaction. * @@ -63,7 +63,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 c38afadca36c3..64f9553d9e581 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. */ @@ -34,6 +30,10 @@ public final class TagProperties { @JsonProperty(value = "previousLink", access = JsonProperty.Access.WRITE_ONLY) private String previousLink; + /** Creates an instance of TagProperties class. */ + public TagProperties() { + } + /** * Get the tags property: 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 2cd3f869d8e8a..39b9d12741000 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. */ @@ -24,13 +20,16 @@ public final class TagsResultInner extends ProxyResource { private TagProperties innerProperties; /* - * eTag of the resource. To handle concurrent update scenario, this field - * will be used to determine whether the user is updating the latest - * version or not. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ @JsonProperty(value = "eTag") private String etag; + /** Creates an instance of TagsResultInner class. */ + public TagsResultInner() { + } + /** * Get the innerProperties property: 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 97647be02c10a..e7b8394c0b8cb 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. */ @@ -45,6 +41,10 @@ public class UsageDetailInner extends ProxyResource { @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; + /** Creates an instance of UsageDetailInner class. */ + public UsageDetailInner() { + } + /** * Get the etag property: 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 c241892a5f74d..9303dd348a660 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; @@ -53,11 +50,10 @@ public final class AggregatedCostsClientImpl implements AggregatedCostsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface AggregatedCostsService { + public interface AggregatedCostsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption" - + "/aggregatedcost") + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByManagementGroup( @@ -70,8 +66,7 @@ Mono> getByManagementGroup( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing" - + "/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost") + "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getForBillingPeriodByManagementGroup( @@ -93,7 +88,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 +130,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( @@ -160,83 +157,50 @@ private Mono> getByManagement * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. - * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc - * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', - * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. - */ - @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(); - } - }); - } - - /** - * Provides the aggregate cost of a management group and all child management groups by current billing period. - * - * @param managementGroupId Azure Management Group ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a 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())); } /** * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. + * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', + * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementGroupAggregatedCostResultInner getByManagementGroup(String managementGroupId) { - final String filter = null; - return getByManagementGroupAsync(managementGroupId, filter).block(); + public Response getByManagementGroupWithResponse( + String managementGroupId, String filter, Context context) { + return getByManagementGroupWithResponseAsync(managementGroupId, filter, context).block(); } /** * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. - * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc - * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', - * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByManagementGroupWithResponse( - String managementGroupId, String filter, Context context) { - return getByManagementGroupWithResponseAsync(managementGroupId, filter, context).block(); + public ManagementGroupAggregatedCostResultInner getByManagementGroup(String managementGroupId) { + final String filter = null; + return getByManagementGroupWithResponse(managementGroupId, filter, Context.NONE).getValue(); } /** @@ -247,7 +211,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 +255,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 +296,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())); } /** @@ -351,15 +310,17 @@ private Mono getForBillingPeriodByMana * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup( - String managementGroupId, String billingPeriodName) { - return getForBillingPeriodByManagementGroupAsync(managementGroupId, billingPeriodName).block(); + public Response getForBillingPeriodByManagementGroupWithResponse( + String managementGroupId, String billingPeriodName, Context context) { + return getForBillingPeriodByManagementGroupWithResponseAsync(managementGroupId, billingPeriodName, context) + .block(); } /** @@ -367,16 +328,15 @@ public ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementG * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getForBillingPeriodByManagementGroupWithResponse( - String managementGroupId, String billingPeriodName, Context context) { - return getForBillingPeriodByManagementGroupWithResponseAsync(managementGroupId, billingPeriodName, context) - .block(); + public ManagementGroupAggregatedCostResultInner getForBillingPeriodByManagementGroup( + String managementGroupId, String billingPeriodName) { + return getForBillingPeriodByManagementGroupWithResponse(managementGroupId, billingPeriodName, Context.NONE) + .getValue(); } } 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 9465438065536..24c0cc78411a4 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; @@ -27,15 +26,6 @@ public AggregatedCostsImpl( this.serviceManager = serviceManager; } - public ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId) { - ManagementGroupAggregatedCostResultInner inner = this.serviceClient().getByManagementGroup(managementGroupId); - if (inner != null) { - return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByManagementGroupWithResponse( String managementGroupId, String filter, Context context) { Response inner = @@ -51,10 +41,8 @@ public Response getByManagementGroupWithRes } } - public ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( - String managementGroupId, String billingPeriodName) { - ManagementGroupAggregatedCostResultInner inner = - this.serviceClient().getForBillingPeriodByManagementGroup(managementGroupId, billingPeriodName); + public ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId) { + ManagementGroupAggregatedCostResultInner inner = this.serviceClient().getByManagementGroup(managementGroupId); if (inner != null) { return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); } else { @@ -79,6 +67,17 @@ public Response getForBillingPeriodByManage } } + public ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( + String managementGroupId, String billingPeriodName) { + ManagementGroupAggregatedCostResultInner inner = + this.serviceClient().getForBillingPeriodByManagementGroup(managementGroupId, billingPeriodName); + if (inner != null) { + return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); + } else { + return null; + } + } + private AggregatedCostsClient serviceClient() { return this.innerClient; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java index 2f73babf5e6d9..5dfef26a7afc3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BalanceImpl.java @@ -101,6 +101,10 @@ public Boolean priceHidden() { return this.innerModel().priceHidden(); } + public BigDecimal overageRefund() { + return this.innerModel().overageRefund(); + } + public List newPurchasesDetails() { List inner = this.innerModel().newPurchasesDetails(); if (inner != null) { 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 142543f3d1a72..5623d7930e6df 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; @@ -52,7 +49,7 @@ public final class BalancesClientImpl implements BalancesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface BalancesService { + public interface BalancesService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances") @ExpectedResponses({200}) @@ -66,8 +63,7 @@ Mono> getByBillingAccount( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}" - + "/providers/Microsoft.Consumption/balances") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getForBillingPeriodByBillingAccount( @@ -87,7 +83,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 +117,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 +148,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())); } /** @@ -170,14 +160,15 @@ private Mono getByBillingAccountAsync(String billingAccountId) { * later. * * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BalanceInner getByBillingAccount(String billingAccountId) { - return getByBillingAccountAsync(billingAccountId).block(); + public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { + return getByBillingAccountWithResponseAsync(billingAccountId, context).block(); } /** @@ -185,15 +176,14 @@ public BalanceInner getByBillingAccount(String billingAccountId) { * later. * * @param billingAccountId BillingAccount ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billingAccountId. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { - return getByBillingAccountWithResponseAsync(billingAccountId, context).block(); + public BalanceInner getByBillingAccount(String billingAccountId) { + return getByBillingAccountWithResponse(billingAccountId, Context.NONE).getValue(); } /** @@ -205,7 +195,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 +240,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 +281,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())); } /** @@ -311,14 +296,17 @@ private Mono getForBillingPeriodByBillingAccountAsync( * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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 BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { - return getForBillingPeriodByBillingAccountAsync(billingAccountId, billingPeriodName).block(); + public Response getForBillingPeriodByBillingAccountWithResponse( + String billingAccountId, String billingPeriodName, Context context) { + return getForBillingPeriodByBillingAccountWithResponseAsync(billingAccountId, billingPeriodName, context) + .block(); } /** @@ -327,16 +315,14 @@ public BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billing period and billingAccountId. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getForBillingPeriodByBillingAccountWithResponse( - String billingAccountId, String billingPeriodName, Context context) { - return getForBillingPeriodByBillingAccountWithResponseAsync(billingAccountId, billingPeriodName, context) - .block(); + public BalanceInner getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { + return getForBillingPeriodByBillingAccountWithResponse(billingAccountId, billingPeriodName, Context.NONE) + .getValue(); } } 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 e1652cddc7cab..f106b96986d71 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; @@ -27,15 +26,6 @@ public BalancesImpl( this.serviceManager = serviceManager; } - public Balance getByBillingAccount(String billingAccountId) { - BalanceInner inner = this.serviceClient().getByBillingAccount(billingAccountId); - if (inner != null) { - return new BalanceImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { Response inner = this.serviceClient().getByBillingAccountWithResponse(billingAccountId, context); if (inner != null) { @@ -49,9 +39,8 @@ public Response getByBillingAccountWithResponse(String billingAccountId } } - public Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { - BalanceInner inner = - this.serviceClient().getForBillingPeriodByBillingAccount(billingAccountId, billingPeriodName); + public Balance getByBillingAccount(String billingAccountId) { + BalanceInner inner = this.serviceClient().getByBillingAccount(billingAccountId); if (inner != null) { return new BalanceImpl(inner, this.manager()); } else { @@ -76,6 +65,16 @@ public Response getForBillingPeriodByBillingAccountWithResponse( } } + public Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { + BalanceInner inner = + this.serviceClient().getForBillingPeriodByBillingAccount(billingAccountId, billingPeriodName); + if (inner != null) { + return new BalanceImpl(inner, this.manager()); + } else { + return null; + } + } + private BalancesClient serviceClient() { return this.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 d1175bb8bab16..6c0f403f7c207 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; @@ -60,7 +57,7 @@ public final class BudgetsClientImpl implements BudgetsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface BudgetsService { + public interface BudgetsService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Consumption/budgets") @ExpectedResponses({200}) @@ -133,12 +130,12 @@ Mono> listNext( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection 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) { @@ -180,13 +177,13 @@ private Mono> listSinglePageAsync(String scope) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @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 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) { @@ -227,12 +224,12 @@ private Mono> listSinglePageAsync(String scope, Conte * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection 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) { @@ -252,13 +249,13 @@ private PagedFlux listAsync(String scope) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { @@ -279,12 +276,12 @@ private PagedFlux listAsync(String scope, Context context) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection 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) { @@ -304,13 +301,13 @@ public PagedIterable list(String scope) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope, Context context) { @@ -330,13 +327,14 @@ public PagedIterable list(String scope, Context context) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -375,14 +373,15 @@ private Mono> getWithResponseAsync(String scope, String bu * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -416,25 +415,17 @@ private Mono> getWithResponseAsync(String scope, String bu * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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())); } /** @@ -450,17 +441,18 @@ private Mono getAsync(String scope, String budgetName) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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 BudgetInner get(String scope, String budgetName) { - return getAsync(scope, budgetName).block(); + public Response getWithResponse(String scope, String budgetName, Context context) { + return getWithResponseAsync(scope, budgetName, context).block(); } /** @@ -476,18 +468,17 @@ public BudgetInner get(String scope, String budgetName) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the budget for the scope by budget name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, String budgetName, Context context) { - return getWithResponseAsync(scope, budgetName, context).block(); + public BudgetInner get(String scope, String budgetName) { + return getWithResponse(scope, budgetName, Context.NONE).getValue(); } /** @@ -505,14 +496,14 @@ public Response getWithResponse(String scope, String budgetName, Co * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a budget resource. + * @return a budget resource along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> createOrUpdateWithResponseAsync( @@ -565,7 +556,7 @@ private Mono> createOrUpdateWithResponseAsync( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. @@ -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( @@ -617,26 +608,19 @@ private Mono> createOrUpdateWithResponseAsync( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a 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())); } /** @@ -654,18 +638,20 @@ private Mono createOrUpdateAsync(String scope, String budgetName, B * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a budget resource. + * @return a budget resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters) { - return createOrUpdateAsync(scope, budgetName, parameters).block(); + public Response createOrUpdateWithResponse( + String scope, String budgetName, BudgetInner parameters, Context context) { + return createOrUpdateWithResponseAsync(scope, budgetName, parameters, context).block(); } /** @@ -683,20 +669,18 @@ public BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner p * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param parameters Parameters supplied to the Create Budget operation. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a budget resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String scope, String budgetName, BudgetInner parameters, Context context) { - return createOrUpdateWithResponseAsync(scope, budgetName, parameters, context).block(); + public BudgetInner createOrUpdate(String scope, String budgetName, BudgetInner parameters) { + return createOrUpdateWithResponse(scope, budgetName, parameters, Context.NONE).getValue(); } /** @@ -712,13 +696,13 @@ public Response createOrUpdateWithResponse( * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the completion. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> deleteWithResponseAsync(String scope, String budgetName) { @@ -757,14 +741,14 @@ private Mono> deleteWithResponseAsync(String scope, String budget * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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) { @@ -799,17 +783,17 @@ private Mono> deleteWithResponseAsync(String scope, String budget * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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()); } /** @@ -825,16 +809,18 @@ private Mono deleteAsync(String scope, String budgetName) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String scope, String budgetName) { - deleteAsync(scope, budgetName).block(); + public Response deleteWithResponse(String scope, String budgetName, Context context) { + return deleteWithResponseAsync(scope, budgetName, context).block(); } /** @@ -850,28 +836,27 @@ public void delete(String scope, String budgetName) { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String scope, String budgetName, Context context) { - return deleteWithResponseAsync(scope, budgetName, context).block(); + public void delete(String scope, String budgetName) { + deleteWithResponse(scope, budgetName, Context.NONE); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -902,12 +887,13 @@ private Mono> listNextSinglePageAsync(String nextLink /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 533b9307c6445..7fbede8d3d939 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; @@ -38,15 +37,6 @@ public PagedIterable list(String scope, Context context) { return Utils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); } - public Budget get(String scope, String budgetName) { - BudgetInner inner = this.serviceClient().get(scope, budgetName); - if (inner != null) { - return new BudgetImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String scope, String budgetName, Context context) { Response inner = this.serviceClient().getWithResponse(scope, budgetName, context); if (inner != null) { @@ -60,21 +50,30 @@ public Response getWithResponse(String scope, String budgetName, Context } } - public void deleteByResourceGroup(String scope, String budgetName) { - this.serviceClient().delete(scope, budgetName); + public Budget get(String scope, String budgetName) { + BudgetInner inner = this.serviceClient().get(scope, budgetName); + if (inner != null) { + return new BudgetImpl(inner, this.manager()); + } else { + return null; + } } - public Response deleteWithResponse(String scope, String budgetName, Context context) { + public Response deleteByResourceGroupWithResponse(String scope, String budgetName, Context context) { return this.serviceClient().deleteWithResponse(scope, budgetName, context); } + public void deleteByResourceGroup(String scope, String budgetName) { + this.serviceClient().delete(scope, budgetName); + } + public Budget getById(String id) { String scope = Utils .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,12 +131,12 @@ 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))); } - this.deleteWithResponse(scope, budgetName, Context.NONE); + this.deleteByResourceGroupWithResponse(scope, budgetName, Context.NONE); } public Response deleteByIdWithResponse(String id, Context context) { @@ -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,12 +155,12 @@ 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))); } - return this.deleteWithResponse(scope, budgetName, context); + return this.deleteByResourceGroupWithResponse(scope, budgetName, context); } private BudgetsClient serviceClient() { 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 7a1bc33418ff3..f70ce414b7490 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; @@ -52,7 +49,7 @@ public final class ChargesClientImpl implements ChargesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ChargesService { + public interface ChargesService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Consumption/charges") @ExpectedResponses({200}) @@ -84,9 +81,9 @@ Mono> list( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param startDate Start date. * @param endDate End date. @@ -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( @@ -146,9 +143,9 @@ private Mono> listWithResponseAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param startDate Start date. * @param endDate End date. @@ -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( @@ -206,60 +203,14 @@ private Mono> listWithResponseAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. - * @param startDate Start date. - * @param endDate End date. - * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, - * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by - * properties/invoiceSectionId. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if 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. - */ - @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(); - } - }); - } - - /** - * Lists the charges based for the defined scope. - * - * @param scope The scope associated with charges operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope. For department and enrollment accounts, you can also add billing period to the - * scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing - * period at department scope use - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. - * Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' - * for billingAccount scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 +219,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())); } /** @@ -293,22 +237,28 @@ private Mono listAsync(String scope) { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. + * @param startDate Start date. + * @param endDate End date. + * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, + * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by + * properties/invoiceSectionId. + * @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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ChargesListResultInner list(String scope) { - final String startDate = null; - final String endDate = null; - final String filter = null; - final String apply = null; - return listAsync(scope, startDate, endDate, filter, apply).block(); + public Response listWithResponse( + String scope, String startDate, String endDate, String filter, String apply, Context context) { + return listWithResponseAsync(scope, startDate, endDate, filter, apply, context).block(); } /** @@ -326,27 +276,21 @@ public ChargesListResultInner list(String scope) { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. - * @param startDate Start date. - * @param endDate End date. - * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, - * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by - * properties/invoiceSectionId. - * @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 charge summary. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse( - String scope, String startDate, String endDate, String filter, String apply, Context context) { - return listWithResponseAsync(scope, startDate, endDate, filter, apply, context).block(); + public ChargesListResultInner list(String scope) { + final String startDate = null; + final String endDate = null; + final String filter = null; + final String apply = null; + return listWithResponse(scope, startDate, endDate, filter, apply, Context.NONE).getValue(); } } 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 f698da5201545..ac7878938b316 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; @@ -27,15 +26,6 @@ public ChargesImpl( this.serviceManager = serviceManager; } - public ChargesListResult list(String scope) { - ChargesListResultInner inner = this.serviceClient().list(scope); - if (inner != null) { - return new ChargesListResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response listWithResponse( String scope, String startDate, String endDate, String filter, String apply, Context context) { Response inner = @@ -51,6 +41,15 @@ public Response listWithResponse( } } + public ChargesListResult list(String scope) { + ChargesListResultInner inner = this.serviceClient().list(scope); + if (inner != null) { + return new ChargesListResultImpl(inner, this.manager()); + } else { + return null; + } + } + private ChargesClient serviceClient() { return this.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 efd5a406aff68..1eab26e15a0e5 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; } @@ -120,27 +119,26 @@ public ConsumptionManagementClientBuilder serializerAdapter(SerializerAdapter se * @return an instance of ConsumptionManagementClientImpl. */ public ConsumptionManagementClientImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - 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(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); ConsumptionManagementClientImpl client = new ConsumptionManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + localPipeline, + localSerializerAdapter, + localDefaultPollInterval, + localEnvironment, + subscriptionId, + localEndpoint); return client; } } 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 d4a20bf01a4c4..b363462a892ac 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; @@ -352,7 +350,7 @@ public CreditsClient getCredits() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-10-01"; + this.apiVersion = "2023-03-01"; this.usageDetails = new UsageDetailsClientImpl(this); this.marketplaces = new MarketplacesClientImpl(this); this.budgets = new BudgetsClientImpl(this); @@ -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/CreditSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java index b82df9ee09f2e..a2eb6d2842fd0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/CreditSummaryImpl.java @@ -9,8 +9,6 @@ import com.azure.resourcemanager.consumption.models.CreditBalanceSummary; import com.azure.resourcemanager.consumption.models.CreditSummary; import com.azure.resourcemanager.consumption.models.Reseller; -import java.util.Collections; -import java.util.Map; public final class CreditSummaryImpl implements CreditSummary { private CreditSummaryInner innerObject; @@ -39,15 +37,6 @@ public String etag() { return this.innerModel().etag(); } - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - public CreditBalanceSummary balanceSummary() { return this.innerModel().balanceSummary(); } @@ -76,6 +65,10 @@ public Reseller reseller() { return this.innerModel().reseller(); } + public Boolean isEstimatedBalance() { + return this.innerModel().isEstimatedBalance(); + } + public String etagPropertiesEtag() { return this.innerModel().etagPropertiesEtag(); } 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 0167b867175e4..bdd9ce2f6c3dd 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; @@ -52,11 +49,10 @@ public final class CreditsClientImpl implements CreditsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface CreditsService { + public interface CreditsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/credits/balanceSummary") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary") @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get( @@ -76,7 +72,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 +114,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 +153,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())); } /** @@ -177,14 +166,16 @@ private Mono getAsync(String billingAccountId, String billin * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a credit summary resource. + * @return a credit summary resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CreditSummaryInner get(String billingAccountId, String billingProfileId) { - return getAsync(billingAccountId, billingProfileId).block(); + public Response getWithResponse( + String billingAccountId, String billingProfileId, Context context) { + return getWithResponseAsync(billingAccountId, billingProfileId, context).block(); } /** @@ -192,15 +183,13 @@ public CreditSummaryInner get(String billingAccountId, String billingProfileId) * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a credit summary resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String billingAccountId, String billingProfileId, Context context) { - return getWithResponseAsync(billingAccountId, billingProfileId, context).block(); + public CreditSummaryInner get(String billingAccountId, String billingProfileId) { + return getWithResponse(billingAccountId, billingProfileId, Context.NONE).getValue(); } } 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 0a36ba8d42d25..4a2d668efb8ab 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; @@ -27,15 +26,6 @@ public CreditsImpl( this.serviceManager = serviceManager; } - public CreditSummary get(String billingAccountId, String billingProfileId) { - CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); - if (inner != null) { - return new CreditSummaryImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String billingAccountId, String billingProfileId, Context context) { Response inner = this.serviceClient().getWithResponse(billingAccountId, billingProfileId, context); @@ -50,6 +40,15 @@ public Response getWithResponse(String billingAccountId, String b } } + public CreditSummary get(String billingAccountId, String billingProfileId) { + CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); + if (inner != null) { + return new CreditSummaryImpl(inner, this.manager()); + } else { + return null; + } + } + private CreditsClient serviceClient() { return this.innerClient; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java index 6cc49c40a5769..854c998d50140 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventSummaryImpl.java @@ -127,6 +127,10 @@ public AmountWithExchangeRate closedBalanceInBillingCurrency() { return this.innerModel().closedBalanceInBillingCurrency(); } + public Boolean isEstimatedBalance() { + return this.innerModel().isEstimatedBalance(); + } + public String etagPropertiesEtag() { return this.innerModel().etagPropertiesEtag(); } 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 669bd221ad8df..b15fcf62eeb6a 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; @@ -58,11 +55,10 @@ public final class EventsOperationsClientImpl implements EventsOperationsClient */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface EventsOperationsService { + public interface EventsOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/events") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -119,7 +115,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 +179,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 +239,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 +261,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 +282,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 +302,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 +322,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 +374,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 +417,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 +434,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 +456,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 +474,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 +494,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( @@ -505,11 +505,13 @@ public PagedIterable listByBillingAccount( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -541,12 +543,14 @@ private Mono> listByBillingProfileNextSinglePag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -578,11 +582,13 @@ private Mono> listByBillingProfileNextSinglePag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -614,12 +620,14 @@ private Mono> listByBillingAccountNextSinglePag /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 4e5f0b2bd8f4b..51c88eed0f573 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/LotSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java index f368ffca6d3bf..589bec021d389 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotSummaryImpl.java @@ -92,6 +92,10 @@ public Reseller reseller() { return this.innerModel().reseller(); } + public Boolean isEstimatedBalance() { + return this.innerModel().isEstimatedBalance(); + } + public String etagPropertiesEtag() { return this.innerModel().etagPropertiesEtag(); } 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 e17ef7138dbc8..8825b490715b5 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; @@ -58,11 +55,10 @@ public final class LotsOperationsClientImpl implements LotsOperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface LotsOperationsService { + public interface LotsOperationsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/lots") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -85,6 +81,20 @@ 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 +114,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 +179,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 +188,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 +229,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 +247,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 +256,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 +267,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 +283,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 +292,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 +301,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 +311,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 +351,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 +362,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 +394,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 +404,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 +414,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 +432,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 +443,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 +454,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 +470,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 +481,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,14 +489,219 @@ 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. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -508,12 +733,13 @@ private Mono> listByBillingProfileNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -545,11 +771,12 @@ private Mono> listByBillingProfileNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -581,12 +808,13 @@ private Mono> listByBillingAccountNextSinglePageA /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 +842,77 @@ private Mono> listByBillingAccountNextSinglePageA res.getValue().nextLink(), null)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 URL to get the next list of items + *

The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing 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 82f0b140a011b..11efdf49d1a48 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 0584db96fe5a3..4539bb006d2a3 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; @@ -58,10 +55,10 @@ public final class MarketplacesClientImpl implements MarketplacesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface MarketplacesService { + public interface MarketplacesService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Consumption/marketplaces") - @ExpectedResponses({200}) + @ExpectedResponses({200, 204}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @@ -75,7 +72,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, @@ -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( @@ -354,11 +351,12 @@ public PagedIterable list( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -389,12 +387,13 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 5cab05762de79..7cc6b97013ed0 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/OperationStatusImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationStatusImpl.java new file mode 100644 index 0000000000000..3c69c72d3bf17 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationStatusImpl.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.implementation; + +import com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.consumption.models.OperationStatus; +import com.azure.resourcemanager.consumption.models.OperationStatusType; +import java.time.OffsetDateTime; + +public final class OperationStatusImpl implements OperationStatus { + private OperationStatusInner innerObject; + + private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; + + OperationStatusImpl( + OperationStatusInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public OperationStatusType status() { + return this.innerModel().status(); + } + + public String downloadUrl() { + return this.innerModel().downloadUrl(); + } + + public OffsetDateTime validTill() { + return this.innerModel().validTill(); + } + + public OperationStatusInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.consumption.ConsumptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsClientImpl.java index 9146d37513dff..e24cc648be700 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; @@ -58,7 +55,7 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface OperationsService { + public interface OperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Consumption/operations") @ExpectedResponses({200}) @@ -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) { @@ -199,11 +198,13 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -234,12 +235,14 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 d7b61340083e6..a37c89b5ed6f4 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 e01c7433932aa..a22ca106addfb 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 @@ -11,6 +11,7 @@ import com.azure.core.annotation.Host; import com.azure.core.annotation.HostParam; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceInterface; @@ -19,17 +20,20 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.consumption.fluent.PriceSheetsClient; +import com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner; import com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** An instance of this class provides access to all the operations defined in 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; @@ -53,7 +57,7 @@ public final class PriceSheetsClientImpl implements PriceSheetsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface PriceSheetsService { + public interface PriceSheetsService { @Headers({"Content-Type: application/json"}) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default") @ExpectedResponses({200}) @@ -70,8 +74,7 @@ Mono> get( @Headers({"Content-Type: application/json"}) @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers" - + "/Microsoft.Consumption/pricesheets/default") + "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByBillingPeriod( @@ -84,6 +87,19 @@ Mono> getByBillingPeriod( @PathParam("billingPeriodName") String billingPeriodName, @HeaderParam("Accept") String accept, Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/download") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> downloadByBillingAccountPeriod( + @HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, + @QueryParam("api-version") String apiVersion, + @PathParam("billingPeriodName") String billingPeriodName, + @HeaderParam("Accept") String accept, + Context context); } /** @@ -98,7 +114,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 +160,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( @@ -175,69 +191,19 @@ private Mono> getWithResponseAsync( context); } - /** - * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. - * - * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields - * are not included when returning price sheet. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the top N results. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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. - */ - @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(); - } - }); - } - /** * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a 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(); - } - }); - } - - /** - * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PriceSheetResultInner get() { - final String expand = null; - final String skiptoken = null; - final Integer top = null; - return getAsync(expand, skiptoken, top).block(); + return getWithResponseAsync(expand, skiptoken, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -253,7 +219,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( @@ -261,6 +227,21 @@ public Response getWithResponse( return getWithResponseAsync(expand, skiptoken, top, context).block(); } + /** + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + * + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the price sheet for a subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PriceSheetResultInner get() { + final String expand = null; + final String skiptoken = null; + final Integer top = null; + return getWithResponse(expand, skiptoken, top, Context.NONE).getValue(); + } + /** * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only * for May 1, 2014 or later. @@ -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( @@ -365,6 +348,26 @@ private Mono> getByBillingPeriodWithResponseAsyn context); } + /** + * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only + * for May 1, 2014 or later. + * + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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) { + final String expand = null; + final String skiptoken = null; + final Integer top = null; + return getByBillingPeriodWithResponseAsync(billingPeriodName, expand, skiptoken, top) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + /** * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only * for May 1, 2014 or later. @@ -376,23 +379,16 @@ private Mono> getByBillingPeriodWithResponseAsyn * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that * specifies a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the top N results. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the 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) - 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(); - } - }); + public Response getByBillingPeriodWithResponse( + String billingPeriodName, String expand, String skiptoken, Integer top, Context context) { + return getByBillingPeriodWithResponseAsync(billingPeriodName, expand, skiptoken, top, context).block(); } /** @@ -406,59 +402,246 @@ private Mono getByBillingPeriodAsync( * @return the price sheet for a scope by subscriptionId and billing period. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingPeriodAsync(String billingPeriodName) { + public PriceSheetResultInner getByBillingPeriod(String billingPeriodName) { final String expand = null; 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(); - } - }); + return getByBillingPeriodWithResponse(billingPeriodName, expand, skiptoken, top, Context.NONE).getValue(); } /** - * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only - * for May 1, 2014 or later. + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. * + * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a scope by subscriptionId and billing period. + * @return the status of the long running operation along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PriceSheetResultInner getByBillingPeriod(String billingPeriodName) { - final String expand = null; - final String skiptoken = null; - final Integer top = null; - return getByBillingPeriodAsync(billingPeriodName, expand, skiptoken, top).block(); + private Mono>> downloadByBillingAccountPeriodWithResponseAsync( + String billingAccountId, String billingPeriodName) { + 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 (billingPeriodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .downloadByBillingAccountPeriod( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + billingPeriodName, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only - * for May 1, 2014 or later. + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. * + * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields - * are not included when returning price sheet. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the top N results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a scope by subscriptionId and billing period. + * @return the status of the long running operation along with {@link Response} on successful completion of {@link + * Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByBillingPeriodWithResponse( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context) { - return getByBillingPeriodWithResponseAsync(billingPeriodName, expand, skiptoken, top, context).block(); + private Mono>> downloadByBillingAccountPeriodWithResponseAsync( + String billingAccountId, String billingPeriodName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + if (billingPeriodName == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingPeriodName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .downloadByBillingAccountPeriod( + this.client.getEndpoint(), + billingAccountId, + this.client.getApiVersion(), + billingPeriodName, + accept, + context); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginDownloadByBillingAccountPeriodAsync( + String billingAccountId, String billingPeriodName) { + Mono>> mono = + downloadByBillingAccountPeriodWithResponseAsync(billingAccountId, billingPeriodName); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + OperationStatusInner.class, + OperationStatusInner.class, + this.client.getContext()); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, OperationStatusInner> beginDownloadByBillingAccountPeriodAsync( + String billingAccountId, String billingPeriodName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + downloadByBillingAccountPeriodWithResponseAsync(billingAccountId, billingPeriodName, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), OperationStatusInner.class, OperationStatusInner.class, context); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginDownloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName) { + return this.beginDownloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName).getSyncPoller(); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, OperationStatusInner> beginDownloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName, Context context) { + return this + .beginDownloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName, context) + .getSyncPoller(); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadByBillingAccountPeriodAsync( + String billingAccountId, String billingPeriodName) { + return beginDownloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono downloadByBillingAccountPeriodAsync( + String billingAccountId, String billingPeriodName, Context context) { + return beginDownloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName) { + return downloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName).block(); + } + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public OperationStatusInner downloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName, Context context) { + return downloadByBillingAccountPeriodAsync(billingAccountId, billingPeriodName, context).block(); } } 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 88be3122b0c34..68ac2e5d19e0e 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 @@ -9,13 +9,14 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.PriceSheetsClient; +import com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner; import com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner; +import com.azure.resourcemanager.consumption.models.OperationStatus; 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; @@ -27,15 +28,6 @@ public PriceSheetsImpl( this.serviceManager = serviceManager; } - public PriceSheetResult get() { - PriceSheetResultInner inner = this.serviceClient().get(); - if (inner != null) { - return new PriceSheetResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String expand, String skiptoken, Integer top, Context context) { Response inner = this.serviceClient().getWithResponse(expand, skiptoken, top, context); if (inner != null) { @@ -49,8 +41,8 @@ public Response getWithResponse(String expand, String skiptoke } } - public PriceSheetResult getByBillingPeriod(String billingPeriodName) { - PriceSheetResultInner inner = this.serviceClient().getByBillingPeriod(billingPeriodName); + public PriceSheetResult get() { + PriceSheetResultInner inner = this.serviceClient().get(); if (inner != null) { return new PriceSheetResultImpl(inner, this.manager()); } else { @@ -73,6 +65,36 @@ public Response getByBillingPeriodWithResponse( } } + public PriceSheetResult getByBillingPeriod(String billingPeriodName) { + PriceSheetResultInner inner = this.serviceClient().getByBillingPeriod(billingPeriodName); + if (inner != null) { + return new PriceSheetResultImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName) { + OperationStatusInner inner = + this.serviceClient().downloadByBillingAccountPeriod(billingAccountId, billingPeriodName); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + + public OperationStatus downloadByBillingAccountPeriod( + String billingAccountId, String billingPeriodName, Context context) { + OperationStatusInner inner = + this.serviceClient().downloadByBillingAccountPeriod(billingAccountId, billingPeriodName, context); + if (inner != null) { + return new OperationStatusImpl(inner, this.manager()); + } else { + return null; + } + } + private PriceSheetsClient serviceClient() { return this.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 309f8e08f0036..b4b1bb0c71943 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; @@ -61,15 +59,16 @@ public final class ReservationRecommendationDetailsClientImpl implements Reserva */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationRecommendationDetailsService { + public 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,70 +231,71 @@ 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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ @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(); + public Response getWithResponse( + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context) { + return getWithResponseAsync(resourceScope, scope, region, term, lookBackPeriod, product, context).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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). - * @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 reservation recommendation details. */ @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(); + public ReservationRecommendationDetailsModelInner get( + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + return getWithResponse(resourceScope, scope, region, term, lookBackPeriod, product, Context.NONE).getValue(); } } 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 1116ec92642f8..0c5697333e00a 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; @@ -30,21 +30,16 @@ public ReservationRecommendationDetailsImpl( this.serviceManager = serviceManager; } - public ReservationRecommendationDetailsModel get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { - ReservationRecommendationDetailsModelInner inner = - this.serviceClient().get(scope, region, term, lookBackPeriod, product); - if (inner != null) { - return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); - } else { - return null; - } - } - 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(), @@ -56,6 +51,17 @@ public Response getWithResponse( } } + public ReservationRecommendationDetailsModel get( + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product) { + ReservationRecommendationDetailsModelInner inner = + this.serviceClient().get(resourceScope, scope, region, term, lookBackPeriod, product); + if (inner != null) { + return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); + } else { + return null; + } + } + private ReservationRecommendationDetailsClient serviceClient() { return this.innerClient; } 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 975c9309d1abc..9e19422477b6c 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; @@ -60,16 +57,16 @@ public final class ReservationRecommendationsClientImpl implements ReservationRe */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationRecommendationsService { + public 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,21 +301,23 @@ 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)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -337,12 +348,14 @@ private Mono> listNextSinglePageAs /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 654187b197f11..0539003833427 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 6db0c98bfb338..3f05119add8d4 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,18 +25,16 @@ 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; import com.azure.resourcemanager.consumption.models.ModernReservationTransactionsListResult; import com.azure.resourcemanager.consumption.models.ReservationTransactionsListResult; +import java.math.BigDecimal; import reactor.core.publisher.Mono; /** 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; @@ -61,25 +59,25 @@ public final class ReservationTransactionsClientImpl implements ReservationTrans */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationTransactionsService { + public interface ReservationTransactionsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption" - + "/reservationTransactions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/reservationTransactions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list( @HostParam("$host") String endpoint, @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, + @QueryParam("useMarkupIfPartner") Boolean useMarkupIfPartner, + @QueryParam("previewMarkupPercentage") BigDecimal previewMarkupPercentage, @PathParam("billingAccountId") String billingAccountId, @HeaderParam("Accept") String accept, Context context); @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/reservationTransactions") + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( @@ -113,19 +111,29 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 billingAccountId, String filter) { + String billingAccountId, String filter, Boolean useMarkupIfPartner, BigDecimal previewMarkupPercentage) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -145,6 +153,8 @@ private Mono> listSinglePageAsync( this.client.getEndpoint(), filter, this.client.getApiVersion(), + useMarkupIfPartner, + previewMarkupPercentage, billingAccountId, accept, context)) @@ -161,20 +171,34 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @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( - String billingAccountId, String filter, Context context) { + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + Context context) { if (this.client.getEndpoint() == null) { return Mono .error( @@ -188,7 +212,15 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), billingAccountId, accept, context) + .list( + this.client.getEndpoint(), + filter, + this.client.getApiVersion(), + useMarkupIfPartner, + previewMarkupPercentage, + billingAccountId, + accept, + context) .map( res -> new PagedResponseBase<>( @@ -201,100 +233,160 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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) { + private PagedFlux listAsync( + String billingAccountId, String filter, Boolean useMarkupIfPartner, BigDecimal previewMarkupPercentage) { return new PagedFlux<>( - () -> listSinglePageAsync(billingAccountId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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) { final String filter = null; + final Boolean useMarkupIfPartner = null; + final BigDecimal previewMarkupPercentage = null; return new PagedFlux<>( - () -> listSinglePageAsync(billingAccountId, filter), nextLink -> listNextSinglePageAsync(nextLink)); + () -> listSinglePageAsync(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @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) { + private PagedFlux listAsync( + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(billingAccountId, filter, context), + () -> listSinglePageAsync(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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) { final String filter = null; - return new PagedIterable<>(listAsync(billingAccountId, filter)); + final Boolean useMarkupIfPartner = null; + final BigDecimal previewMarkupPercentage = null; + return new PagedIterable<>(listAsync(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage)); } /** - * 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @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) { - return new PagedIterable<>(listAsync(billingAccountId, filter, context)); + public PagedIterable list( + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + Context context) { + return new PagedIterable<>( + listAsync(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage, 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +431,24 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +490,22 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +516,18 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +539,23 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +566,18 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 +587,23 @@ 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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( @@ -489,11 +614,13 @@ public PagedIterable listByBillingProfile( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -524,12 +651,14 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -560,11 +689,13 @@ private Mono> listNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -597,12 +728,14 @@ private Mono> listByBillingProf /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 b91b2303ad4b8..192f6093dd4fd 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,10 @@ 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; +import java.math.BigDecimal; 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; @@ -34,8 +34,14 @@ public PagedIterable list(String billingAccountId) { return Utils.mapPage(inner, inner1 -> new ReservationTransactionImpl(inner1, this.manager())); } - public PagedIterable list(String billingAccountId, String filter, Context context) { - PagedIterable inner = this.serviceClient().list(billingAccountId, filter, context); + public PagedIterable list( + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + Context context) { + PagedIterable inner = + this.serviceClient().list(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage, context); return Utils.mapPage(inner, inner1 -> new ReservationTransactionImpl(inner1, this.manager())); } 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 4056015306802..b657876f74cc4 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; @@ -58,11 +55,10 @@ public final class ReservationsDetailsClientImpl implements ReservationsDetailsC */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationsDetailsService { + public interface ReservationsDetailsService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption" - + "/reservationDetails") + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrder( @@ -75,8 +71,7 @@ Mono> listByReservationOrder( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}" - + "/providers/Microsoft.Consumption/reservationDetails") + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservation( @@ -89,12 +84,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, @@ -136,7 +131,11 @@ Mono> listNext( } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -144,7 +143,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( @@ -187,7 +187,11 @@ private Mono> listByReservationOrderSingle } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -196,7 +200,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( @@ -231,7 +236,11 @@ private Mono> listByReservationOrderSingle } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -239,7 +248,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) { @@ -249,7 +258,11 @@ private PagedFlux listByReservationOrderAsync(String res } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -258,7 +271,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( @@ -269,7 +282,11 @@ private PagedFlux listByReservationOrderAsync( } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -277,7 +294,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) { @@ -285,7 +302,11 @@ public PagedIterable listByReservationOrder(String reser } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -294,7 +315,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( @@ -303,7 +324,11 @@ public PagedIterable listByReservationOrder( } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -312,7 +337,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( @@ -359,7 +385,11 @@ private Mono> listByReservationOrderAndRes } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -369,7 +399,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( @@ -413,7 +444,11 @@ private Mono> listByReservationOrderAndRes } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -422,7 +457,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( @@ -433,7 +468,11 @@ private PagedFlux listByReservationOrderAndReservationAs } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -443,7 +482,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( @@ -455,7 +494,11 @@ private PagedFlux listByReservationOrderAndReservationAs } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -464,7 +507,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( @@ -474,7 +517,11 @@ public PagedIterable listByReservationOrderAndReservatio } /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -484,7 +531,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( @@ -494,9 +541,13 @@ public PagedIterable listByReservationOrderAndReservatio } /** - * Lists the reservations details for the defined scope and provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +562,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 +579,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 +589,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - scope, + resourceScope, startDate, endDate, filter, @@ -559,9 +611,13 @@ private Mono> listSinglePageAsync( } /** - * Lists the reservations details for the defined scope and provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +633,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 +651,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, @@ -623,9 +680,13 @@ private Mono> listSinglePageAsync( } /** - * Lists the reservations details for the defined scope and provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +701,57 @@ 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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +767,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 +779,47 @@ 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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +835,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,17 +847,19 @@ 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)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -809,12 +891,14 @@ private Mono> listByReservationOrderNextSi /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -846,11 +930,13 @@ private Mono> listByReservationOrderNextSi /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -885,12 +971,14 @@ private Mono> listByReservationOrderAndRes /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -922,11 +1010,13 @@ private Mono> listByReservationOrderAndRes /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -957,12 +1047,14 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 baf24d702654e..4666b5d719906 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 18b19328a4edb..c05c5de9dc781 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; @@ -60,11 +57,10 @@ public final class ReservationsSummariesClientImpl implements ReservationsSummar */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationsSummariesService { + public interface ReservationsSummariesService { @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption" - + "/reservationSummaries") + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrder( @@ -78,8 +74,7 @@ Mono> listByReservationOrder( @Headers({"Content-Type: application/json"}) @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}" - + "/providers/Microsoft.Consumption/reservationSummaries") + "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries") @ExpectedResponses({200}) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservation( @@ -93,12 +88,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, @@ -141,7 +136,9 @@ Mono> listNext( } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -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( @@ -194,7 +192,9 @@ private Mono> listByReservationOrderSingl } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -204,7 +204,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( @@ -245,7 +246,9 @@ private Mono> listByReservationOrderSingl } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -254,7 +257,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( @@ -265,14 +268,16 @@ private PagedFlux listByReservationOrderAsync( } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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) { @@ -283,7 +288,9 @@ private PagedFlux listByReservationOrderAsync(String re } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -293,7 +300,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( @@ -304,14 +311,16 @@ private PagedFlux listByReservationOrderAsync( } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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) { @@ -320,7 +329,9 @@ public PagedIterable listByReservationOrder(String rese } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -330,7 +341,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( @@ -339,7 +350,9 @@ public PagedIterable listByReservationOrder( } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -349,7 +362,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( @@ -397,7 +411,9 @@ private Mono> listByReservationOrderAndRe } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -408,7 +424,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( @@ -453,7 +470,9 @@ private Mono> listByReservationOrderAndRe } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -463,7 +482,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( @@ -474,7 +493,9 @@ private PagedFlux listByReservationOrderAndReservationA } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -482,7 +503,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( @@ -494,7 +515,9 @@ private PagedFlux listByReservationOrderAndReservationA } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -505,7 +528,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( @@ -518,7 +541,9 @@ private PagedFlux listByReservationOrderAndReservationA } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -526,7 +551,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( @@ -537,7 +562,9 @@ public PagedIterable listByReservationOrderAndReservati } /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -548,7 +575,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( @@ -558,9 +585,11 @@ public PagedIterable listByReservationOrderAndReservati } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +605,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 +623,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 +636,7 @@ private Mono> listSinglePageAsync( service .list( this.client.getEndpoint(), - scope, + resourceScope, grain, startDate, endDate, @@ -629,9 +659,11 @@ private Mono> listSinglePageAsync( } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +680,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 +699,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 +710,7 @@ private Mono> listSinglePageAsync( return service .list( this.client.getEndpoint(), - scope, + resourceScope, grain, startDate, endDate, @@ -699,9 +732,11 @@ private Mono> listSinglePageAsync( } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +752,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 +764,18 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +783,28 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +821,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 +836,16 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +853,25 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +888,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,17 +901,19 @@ 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)); } /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -896,12 +945,14 @@ private Mono> listByReservationOrderNextS /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -933,11 +984,13 @@ private Mono> listByReservationOrderNextS /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -972,12 +1025,14 @@ private Mono> listByReservationOrderAndRe /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( @@ -1009,11 +1064,13 @@ private Mono> listByReservationOrderAndRe /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -1044,12 +1101,14 @@ private Mono> listNextSinglePageAsync(Str /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 05a85e5bf2330..4ac4bc3ff390b 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 67df95a5b2186..16219879d7dd6 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; @@ -52,7 +49,7 @@ public final class TagsClientImpl implements TagsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface TagsService { + public interface TagsService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Consumption/tags") @ExpectedResponses({200, 204}) @@ -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())); } /** @@ -172,14 +163,15 @@ private Mono getAsync(String scope) { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. + * @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 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 TagsResultInner get(String scope) { - return getAsync(scope).block(); + public Response getWithResponse(String scope, Context context) { + return getWithResponseAsync(scope, context).block(); } /** @@ -193,14 +185,13 @@ public TagsResultInner get(String scope) { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. - * @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 all available tag keys for the defined scope. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String scope, Context context) { - return getWithResponseAsync(scope, context).block(); + public TagsResultInner get(String scope) { + return getWithResponse(scope, Context.NONE).getValue(); } } 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 66f604cb115e0..4f7b0d5952d53 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; @@ -26,15 +25,6 @@ public TagsImpl(TagsClient innerClient, com.azure.resourcemanager.consumption.Co this.serviceManager = serviceManager; } - public TagsResult get(String scope) { - TagsResultInner inner = this.serviceClient().get(scope); - if (inner != null) { - return new TagsResultImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String scope, Context context) { Response inner = this.serviceClient().getWithResponse(scope, context); if (inner != null) { @@ -48,6 +38,15 @@ public Response getWithResponse(String scope, Context context) { } } + public TagsResult get(String scope) { + TagsResultInner inner = this.serviceClient().get(scope); + if (inner != null) { + return new TagsResultImpl(inner, this.manager()); + } else { + return null; + } + } + private TagsClient serviceClient() { return this.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 44a113317cd05..2be2ce216fed8 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; @@ -59,10 +56,10 @@ public final class UsageDetailsClientImpl implements UsageDetailsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface UsageDetailsService { + public 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, @@ -91,6 +88,12 @@ Mono> listNext( * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -104,9 +107,9 @@ Mono> listNext( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -123,7 +126,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( @@ -169,6 +173,12 @@ private Mono> listSinglePageAsync( * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -182,9 +192,9 @@ private Mono> listSinglePageAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -202,7 +212,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( @@ -245,6 +256,12 @@ private Mono> listSinglePageAsync( * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -258,9 +275,9 @@ private Mono> listSinglePageAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -277,7 +294,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( @@ -291,6 +308,12 @@ private PagedFlux listAsync( * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -304,14 +327,14 @@ private PagedFlux listAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -329,6 +352,12 @@ private PagedFlux listAsync(String scope) { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -342,9 +371,9 @@ private PagedFlux listAsync(String scope) { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -362,7 +391,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( @@ -376,6 +405,12 @@ private PagedFlux listAsync( * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -389,14 +424,14 @@ private PagedFlux listAsync( * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -412,6 +447,12 @@ public PagedIterable list(String scope) { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -425,9 +466,9 @@ public PagedIterable list(String scope) { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -445,7 +486,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( @@ -456,11 +497,13 @@ public PagedIterable list( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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) { @@ -491,12 +534,14 @@ private Mono> listNextSinglePageAsync(String nex /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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 0a2f97c4b4a87..a2b45996437cb 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 4f6201d53e824..1f6a59a57d284 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 @@ -13,53 +13,53 @@ public interface AggregatedCosts { * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. + * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc + * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', + * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ - ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId); + Response getByManagementGroupWithResponse( + String managementGroupId, String filter, Context context); /** * Provides the aggregate cost of a management group and all child management groups by current billing period. * * @param managementGroupId Azure Management Group ID. - * @param filter May be used to filter aggregated cost by properties/usageStart (Utc time), properties/usageEnd (Utc - * time). The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', - * or 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ - Response getByManagementGroupWithResponse( - String managementGroupId, String filter, Context context); + ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId); /** * Provides the aggregate cost of a management group and all child management groups by specified billing period. * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a management group aggregated cost resource. + * @return a management group aggregated cost resource along with {@link Response}. */ - ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( - String managementGroupId, String billingPeriodName); + Response getForBillingPeriodByManagementGroupWithResponse( + String managementGroupId, String billingPeriodName, Context context); /** * Provides the aggregate cost of a management group and all child management groups by specified billing period. * * @param managementGroupId Azure Management Group ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a management group aggregated cost resource. */ - Response getForBillingPeriodByManagementGroupWithResponse( - String managementGroupId, String billingPeriodName, Context context); + ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( + String managementGroupId, String billingPeriodName); } 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 ee8a60d5cd91c..bdf4854e58e33 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. */ @@ -27,6 +23,10 @@ public class Amount { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal value; + /** Creates an instance of Amount class. */ + public Amount() { + } + /** * Get the currency property: 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 56359257ad74a..7c4bad31dbd91 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. */ @@ -27,6 +23,10 @@ public final class AmountWithExchangeRate extends Amount { @JsonProperty(value = "exchangeRateMonth", access = JsonProperty.Access.WRITE_ONLY) private Integer exchangeRateMonth; + /** Creates an instance of AmountWithExchangeRate class. */ + public AmountWithExchangeRate() { + } + /** * Get the exchangeRate property: The exchange rate. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java index 05ffe918298a9..1b8066de1aa24 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balance.java @@ -138,6 +138,13 @@ public interface Balance { */ Boolean priceHidden(); + /** + * Gets the overageRefund property: Overage Refunds. + * + * @return the overageRefund value. + */ + BigDecimal overageRefund(); + /** * Gets the newPurchasesDetails property: List of new purchases. * 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 28b35f39200b8..e9db861343236 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. */ @@ -27,6 +23,10 @@ public final class BalancePropertiesAdjustmentDetailsItem { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal value; + /** Creates an instance of BalancePropertiesAdjustmentDetailsItem class. */ + public BalancePropertiesAdjustmentDetailsItem() { + } + /** * Get the name property: 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 88f9ac43b8b41..3bc4f9491546d 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. */ @@ -27,6 +23,10 @@ public final class BalancePropertiesNewPurchasesDetailsItem { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal value; + /** Creates an instance of BalancePropertiesNewPurchasesDetailsItem class. */ + public BalancePropertiesNewPurchasesDetailsItem() { + } + /** * Get the name property: 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 285e4cd37caa5..bedeaf2ac019e 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 @@ -14,25 +14,25 @@ public interface Balances { * later. * * @param billingAccountId BillingAccount ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the balances for a scope by billingAccountId. + * @return the balances for a scope by billingAccountId along with {@link Response}. */ - Balance getByBillingAccount(String billingAccountId); + Response getByBillingAccountWithResponse(String billingAccountId, Context context); /** * Gets the balances for a scope by billingAccountId. Balances are available via this API only for May 1, 2014 or * later. * * @param billingAccountId BillingAccount ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billingAccountId. */ - Response getByBillingAccountWithResponse(String billingAccountId, Context context); + Balance getByBillingAccount(String billingAccountId); /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only @@ -40,12 +40,14 @@ public interface Balances { * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return 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}. */ - Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName); + Response getForBillingPeriodByBillingAccountWithResponse( + String billingAccountId, String billingPeriodName, Context context); /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only @@ -53,12 +55,10 @@ public interface Balances { * * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the balances for a scope by billing period and billingAccountId. */ - Response getForBillingPeriodByBillingAccountWithResponse( - String billingAccountId, String billingPeriodName, Context context); + Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName); } 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 9f47894ab8cb0..73635f8bdde0e 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for BillingFrequency. */ +/** The billing frequency. */ public final class BillingFrequency extends ExpandableStringEnum { /** Static value Month for BillingFrequency. */ public static final BillingFrequency MONTH = fromString("Month"); @@ -19,6 +19,15 @@ public final class BillingFrequency extends ExpandableStringEnum values() { return values(BillingFrequency.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java index 125f395964b84..7e8b60acae0de 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java @@ -132,7 +132,7 @@ interface WithScope { * for Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope. * @return the next definition stage. */ 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 6c4ec428fb0db..27f6f57a9e2b8 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. */ @@ -33,6 +30,10 @@ public final class BudgetComparisonExpression { @JsonProperty(value = "values", required = true) private List values; + /** Creates an instance of BudgetComparisonExpression class. */ + public BudgetComparisonExpression() { + } + /** * Get the name property: The name of the column to use in comparison. * @@ -100,21 +101,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 7af3aa43443e0..3e409611f07e3 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 */ @@ -39,6 +29,10 @@ public final class BudgetFilter { @JsonProperty(value = "tags") private BudgetComparisonExpression tags; + /** Creates an instance of BudgetFilter class. */ + public BudgetFilter() { + } + /** * Get the and property: The logical "AND" expression. Must have at least 2 items. * @@ -59,26 +53,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 +102,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 42ff353a3e6cc..6af06867b4c62 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 */ @@ -26,6 +22,10 @@ public final class BudgetFilterProperties { @JsonProperty(value = "tags") private BudgetComparisonExpression tags; + /** Creates an instance of BudgetFilterProperties class. */ + public BudgetFilterProperties() { + } + /** * Get the dimensions property: 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 605b90e98c054..30e320a94b822 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 @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for BudgetOperatorType. */ +/** The operator to use for comparison. */ public final class BudgetOperatorType extends ExpandableStringEnum { /** Static value In for BudgetOperatorType. */ public static final BudgetOperatorType IN = fromString("In"); + /** + * Creates a new instance of BudgetOperatorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BudgetOperatorType() { + } + /** * Creates or finds a BudgetOperatorType from its string representation. * @@ -24,7 +33,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 05a038d2a479e..328a361a22499 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. */ @@ -22,12 +19,15 @@ public final class BudgetTimePeriod { private OffsetDateTime startDate; /* - * The end date for the budget. If not provided, we default this to 10 - * years from the start date. + * The end date for the budget. If not provided, we default this to 10 years from the start date. */ @JsonProperty(value = "endDate") private OffsetDateTime endDate; + /** Creates an instance of BudgetTimePeriod class. */ + public BudgetTimePeriod() { + } + /** * Get the startDate property: The start date for the budget. * @@ -77,9 +77,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 30473f648fac7..110bad1ba16bb 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 @@ -23,12 +23,12 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); @@ -45,13 +45,13 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @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 budgets. + * @return result of listing budgets as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope, Context context); @@ -68,15 +68,16 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the budget for the scope by budget name. + * @return the budget for the scope by budget name along with {@link Response}. */ - Budget get(String scope, String budgetName); + Response getWithResponse(String scope, String budgetName, Context context); /** * Gets the budget for the scope by budget name. @@ -91,16 +92,15 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the budget for the scope by budget name. */ - Response getWithResponse(String scope, String budgetName, Context context); + Budget get(String scope, String budgetName); /** * The operation to delete a budget. @@ -115,14 +115,16 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link Response}. */ - void deleteByResourceGroup(String scope, String budgetName); + Response deleteByResourceGroupWithResponse(String scope, String budgetName, Context context); /** * The operation to delete a budget. @@ -137,16 +139,14 @@ public interface Budgets { * Management Group scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for * invoiceSection scope. * @param budgetName Budget Name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. */ - Response deleteWithResponse(String scope, String budgetName, Context context); + void deleteByResourceGroup(String scope, String budgetName); /** * Gets the budget for the scope by budget name. @@ -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 bd33a65c2a2b6..6ffe41fc7de0b 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. */ @@ -28,6 +24,10 @@ public final class BudgetsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of BudgetsListResult class. */ + public BudgetsListResult() { + } + /** * Get the value property: 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 cbdbc833c36e1..58446acd3b5bf 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 @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CategoryType. */ +/** The category of the budget, whether the budget tracks cost or usage. */ public final class CategoryType extends ExpandableStringEnum { /** Static value Cost for CategoryType. */ public static final CategoryType COST = fromString("Cost"); + /** + * Creates a new instance of CategoryType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CategoryType() { + } + /** * Creates or finds a CategoryType from its string representation. * @@ -24,7 +33,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 05d8508577baf..7d2c1629a75e9 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,16 +24,17 @@ }) @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 - * version or not. + * eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the + * user is updating the latest version or not. */ @JsonProperty(value = "eTag") private String etag; + /** Creates an instance of ChargeSummary class. */ + public ChargeSummary() { + } + /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. 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 73c6df33f98c6..31b8fee31793c 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ChargeSummaryKind. */ +/** Specifies the kind of charge summary. */ public final class ChargeSummaryKind extends ExpandableStringEnum { /** Static value legacy for ChargeSummaryKind. */ public static final ChargeSummaryKind LEGACY = fromString("legacy"); @@ -16,6 +16,15 @@ public final class ChargeSummaryKind extends ExpandableStringEnum 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 16f0b73abd97a..f5ffe6785358e 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 @@ -24,16 +24,26 @@ public interface Charges { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. + * @param startDate Start date. + * @param endDate End date. + * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). + * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or + * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, + * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by + * properties/invoiceSectionId. + * @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 charge summary. + * @return result of listing charge summary along with {@link Response}. */ - ChargesListResult list(String scope); + Response listWithResponse( + String scope, String startDate, String endDate, String filter, String apply, Context context); /** * Lists the charges based for the defined scope. @@ -50,24 +60,14 @@ public interface Charges { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. - * @param startDate Start date. - * @param endDate End date. - * @param filter May be used to filter charges by properties/usageEnd (Utc time), properties/usageStart (Utc time). - * The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or - * 'not'. Tag filter is a key value pair string where key and value is separated by a colon (:). - * @param apply May be used to group charges for billingAccount scope by properties/billingProfileId, - * properties/invoiceSectionId, properties/customerId (specific for Partner Led), or for billingProfile scope by - * properties/invoiceSectionId. - * @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 charge summary. */ - Response listWithResponse( - String scope, String startDate, String endDate, String filter, String apply, Context context); + ChargesListResult list(String scope); } 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 0610ce0df9c50..f2b9f84548870 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. */ @@ -32,6 +28,10 @@ public final class CreditBalanceSummary { @JsonProperty(value = "estimatedBalanceInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate estimatedBalanceInBillingCurrency; + /** Creates an instance of CreditBalanceSummary class. */ + public CreditBalanceSummary() { + } + /** * Get the estimatedBalance property: Estimated balance. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java index 8db755d5d0f44..4ceb7401bf65e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.consumption.models; import com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner; -import java.util.Map; /** An immutable client-side representation of CreditSummary. */ public interface CreditSummary { @@ -31,19 +30,13 @@ public interface CreditSummary { String type(); /** - * Gets the etag property: The etag for the resource. + * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. * * @return the etag value. */ String etag(); - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - /** * Gets the balanceSummary property: Summary of balances associated with this credit summary. * @@ -93,6 +86,14 @@ public interface CreditSummary { */ Reseller reseller(); + /** + * Gets the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + Boolean isEstimatedBalance(); + /** * Gets the etagPropertiesEtag property: The eTag for the resource. * 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 c81237f13f378..bf5ed3f7321b4 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 @@ -14,23 +14,23 @@ public interface Credits { * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a credit summary resource. + * @return a credit summary resource along with {@link Response}. */ - CreditSummary get(String billingAccountId, String billingProfileId); + Response getWithResponse(String billingAccountId, String billingProfileId, Context context); /** * The credit summary by billingAccountId and billingProfileId. * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a credit summary resource. */ - Response getWithResponse(String billingAccountId, String billingProfileId, Context context); + CreditSummary get(String billingAccountId, String billingProfileId); } 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 a6e0879dd0123..118122b18d385 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for CultureCode. */ +/** Language in which the recipient will receive the notification. */ public final class CultureCode extends ExpandableStringEnum { /** Static value en-us for CultureCode. */ public static final CultureCode EN_US = fromString("en-us"); @@ -73,6 +73,15 @@ public final class CultureCode extends ExpandableStringEnum { /** Static value sv-se for CultureCode. */ public static final CultureCode SV_SE = fromString("sv-se"); + /** + * Creates a new instance of CultureCode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CultureCode() { + } + /** * Creates or finds a CultureCode from its string representation. * @@ -84,7 +93,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 7d1ef07753c7e..3f0900260f5c2 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. */ @@ -27,6 +23,10 @@ public final class CurrentSpend { @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; + /** Creates an instance of CurrentSpend class. */ + public CurrentSpend() { + } + /** * Get the amount property: 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 d1552a898e916..9020be9b26011 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 @@ -16,6 +16,15 @@ public final class Datagrain extends ExpandableStringEnum { /** Static value monthly for Datagrain. */ public static final Datagrain MONTHLY = fromString("monthly"); + /** + * Creates a new instance of Datagrain value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Datagrain() { + } + /** * Creates or finds a Datagrain from its string representation. * @@ -27,7 +36,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/EventSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java index df38c206548c8..b911f971e4de2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventSummary.java @@ -199,6 +199,14 @@ public interface EventSummary { */ AmountWithExchangeRate closedBalanceInBillingCurrency(); + /** + * Gets the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + Boolean isEstimatedBalance(); + /** * Gets the etagPropertiesEtag property: The eTag for the resource. * 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 f5962311e4e55..361c549985a73 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for EventType. */ +/** Identifies the type of the event. */ public final class EventType extends ExpandableStringEnum { /** Static value SettledCharges for EventType. */ public static final EventType SETTLED_CHARGES = fromString("SettledCharges"); @@ -31,6 +31,18 @@ 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 a new instance of EventType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public EventType() { + } + /** * Creates or finds a EventType from its string representation. * @@ -42,7 +54,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 f2c17db4b19bd..5429c344a10e6 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. */ @@ -28,6 +24,10 @@ public final class Events { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of Events class. */ + public Events() { + } + /** * Get the value property: 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 8dba4861b35d8..42b94ac9340e3 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 4ac1667b49b1d..d4b99418679e8 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,20 +5,15 @@ 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 - * forecast alert type. + * 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 forecast alert type. */ @JsonProperty(value = "amount", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal amount; @@ -29,6 +24,10 @@ public final class ForecastSpend { @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; + /** Creates an instance of ForecastSpend class. */ + public ForecastSpend() { + } + /** * Get the amount property: 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 forecast alert type. 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 084f7dd40a584..9fc79842db3e1 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,14 +17,16 @@ @JsonTypeName("legacy") @Fluent public final class LegacyChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummary.class); - /* * Properties for legacy charge summary */ @JsonProperty(value = "properties", required = true) private LegacyChargeSummaryProperties innerProperties = new LegacyChargeSummaryProperties(); + /** Creates an instance of LegacyChargeSummary class. */ + public LegacyChargeSummary() { + } + /** * Get the innerProperties property: Properties for legacy charge summary. * @@ -88,12 +89,12 @@ public BigDecimal chargesBilledSeparately() { } /** - * Get the marketplaceCharges property: Marketplace Charges. + * Get the azureMarketplaceCharges property: Marketplace Charges. * - * @return the marketplaceCharges value. + * @return the azureMarketplaceCharges value. */ - public BigDecimal marketplaceCharges() { - return this.innerProperties() == null ? null : this.innerProperties().marketplaceCharges(); + public BigDecimal azureMarketplaceCharges() { + return this.innerProperties() == null ? null : this.innerProperties().azureMarketplaceCharges(); } /** @@ -114,7 +115,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 +123,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 6ede5b412f975..8fe283585082f 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 @@ -6,163 +6,44 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.fluent.models.LegacyReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; /** Legacy reservation recommendation. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("legacy") @Fluent public final class LegacyReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendation.class); - /* * Properties for legacy reservation recommendation */ @JsonProperty(value = "properties", required = true) - private LegacyReservationRecommendationProperties innerProperties = new LegacyReservationRecommendationProperties(); + private LegacyReservationRecommendationProperties properties; - /** - * Get the innerProperties property: Properties for legacy reservation recommendation. - * - * @return the innerProperties value. - */ - private LegacyReservationRecommendationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. - * - * @return the lookBackPeriod value. - */ - public String lookBackPeriod() { - return this.innerProperties() == null ? null : this.innerProperties().lookBackPeriod(); + /** Creates an instance of LegacyReservationRecommendation class. */ + public LegacyReservationRecommendation() { } /** - * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. + * Get the properties property: Properties for legacy reservation recommendation. * - * @return the instanceFlexibilityRatio value. + * @return the properties value. */ - public Float instanceFlexibilityRatio() { - return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityRatio(); + public LegacyReservationRecommendationProperties properties() { + return this.properties; } /** - * Get the instanceFlexibilityGroup property: The instance Flexibility Group. + * Set the properties property: Properties for legacy reservation recommendation. * - * @return the instanceFlexibilityGroup value. + * @param properties the properties value to set. + * @return the LegacyReservationRecommendation object itself. */ - public String instanceFlexibilityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityGroup(); - } - - /** - * Get the normalizedSize property: The normalized Size. - * - * @return the normalizedSize value. - */ - public String normalizedSize() { - return this.innerProperties() == null ? null : this.innerProperties().normalizedSize(); - } - - /** - * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. - * - * @return the recommendedQuantityNormalized value. - */ - public Float recommendedQuantityNormalized() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantityNormalized(); - } - - /** - * Get the meterId property: The meter id (GUID). - * - * @return the meterId value. - */ - public UUID meterId() { - return this.innerProperties() == null ? null : this.innerProperties().meterId(); - } - - /** - * Get the resourceType property: The azure resource type. - * - * @return the resourceType value. - */ - public String resourceType() { - return this.innerProperties() == null ? null : this.innerProperties().resourceType(); - } - - /** - * Get the term property: RI recommendations in one or three year terms. - * - * @return the term value. - */ - public String term() { - return this.innerProperties() == null ? null : this.innerProperties().term(); - } - - /** - * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. - * - * @return the costWithNoReservedInstances value. - */ - public BigDecimal costWithNoReservedInstances() { - return this.innerProperties() == null ? null : this.innerProperties().costWithNoReservedInstances(); - } - - /** - * Get the recommendedQuantity property: Recommended quality for reserved instances. - * - * @return the recommendedQuantity value. - */ - public BigDecimal recommendedQuantity() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); - } - - /** - * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. - * - * @return the totalCostWithReservedInstances value. - */ - public BigDecimal totalCostWithReservedInstances() { - return this.innerProperties() == null ? null : this.innerProperties().totalCostWithReservedInstances(); - } - - /** - * Get the netSavings property: Total estimated savings with reserved instances. - * - * @return the netSavings value. - */ - public BigDecimal netSavings() { - return this.innerProperties() == null ? null : this.innerProperties().netSavings(); - } - - /** - * Get the firstUsageDate property: The usage date for looking back. - * - * @return the firstUsageDate value. - */ - public OffsetDateTime firstUsageDate() { - return this.innerProperties() == null ? null : this.innerProperties().firstUsageDate(); - } - - /** - * Get the skuProperties property: List of sku properties. - * - * @return the skuProperties value. - */ - public List skuProperties() { - return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); + public LegacyReservationRecommendation withProperties(LegacyReservationRecommendationProperties properties) { + this.properties = properties; + return this; } /** @@ -173,13 +54,15 @@ public List skuProperties() { @Override public void validate() { super.validate(); - if (innerProperties() == null) { - throw logger + if (properties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property innerProperties in model LegacyReservationRecommendation")); + "Missing required property properties in model LegacyReservationRecommendation")); } else { - innerProperties().validate(); + properties().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/fluent/models/LegacyReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendationProperties.java similarity index 92% rename from sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationRecommendationProperties.java rename to sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendationProperties.java index 521171b6a9d19..0aab1e50a3ecd 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/models/LegacyReservationRecommendationProperties.java @@ -2,14 +2,9 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption.fluent.models; +package com.azure.resourcemanager.consumption.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 +27,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. */ @@ -118,6 +111,10 @@ public class LegacyReservationRecommendationProperties { @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY) private List skuProperties; + /** Creates an instance of LegacyReservationRecommendationProperties class. */ + public LegacyReservationRecommendationProperties() { + } + /** * Get the lookBackPeriod property: 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/models/LegacyReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java index e9ebfb4c40a41..a97844a368ac8 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,14 +5,14 @@ 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); + /** Creates an instance of LegacyReservationTransaction class. */ + public LegacyReservationTransaction() { + } /** * 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 df0ec268d7751..a8b680a38d45c 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,6 @@ 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,8 +14,9 @@ @Immutable public final class LegacySharedScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySharedScopeReservationRecommendationProperties.class); + /** Creates an instance of LegacySharedScopeReservationRecommendationProperties class. */ + public LegacySharedScopeReservationRecommendationProperties() { + } /** * 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 16fa7d307c55c..1c382a83d8025 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,6 @@ 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,15 +16,16 @@ @Immutable public final class LegacySingleScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySingleScopeReservationRecommendationProperties.class); - /* * Subscription id associated with single scoped recommendation. */ @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) private UUID subscriptionId; + /** Creates an instance of LegacySingleScopeReservationRecommendationProperties class. */ + public LegacySingleScopeReservationRecommendationProperties() { + } + /** * Get the subscriptionId property: 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 3149ee7269794..e57c449c7d37b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java @@ -4,11 +4,10 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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; @@ -19,16 +18,18 @@ /** Legacy usage detail. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("legacy") -@Fluent +@Immutable public final class LegacyUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetail.class); - /* * Properties for legacy usage details */ @JsonProperty(value = "properties", required = true) private LegacyUsageDetailProperties innerProperties = new LegacyUsageDetailProperties(); + /** Creates an instance of LegacyUsageDetail class. */ + public LegacyUsageDetail() { + } + /** * Get the innerProperties property: Properties for legacy usage details. * @@ -439,6 +440,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 +476,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 +484,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 3488a9665b86d..d4ca26acb6a80 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 @@ -19,6 +19,15 @@ public final class LookBackPeriod extends ExpandableStringEnum { /** Static value Last60Days for LookBackPeriod. */ public static final LookBackPeriod LAST60DAYS = fromString("Last60Days"); + /** + * Creates a new instance of LookBackPeriod value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LookBackPeriod() { + } + /** * Creates or finds a LookBackPeriod from its string representation. * @@ -30,7 +39,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 9db6258330991..adccf76bf0465 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for LotSource. */ +/** The source of the lot. */ public final class LotSource extends ExpandableStringEnum { /** Static value PurchasedCredit for LotSource. */ public static final LotSource PURCHASED_CREDIT = fromString("PurchasedCredit"); @@ -19,6 +19,15 @@ public final class LotSource extends ExpandableStringEnum { /** Static value ConsumptionCommitment for LotSource. */ public static final LotSource CONSUMPTION_COMMITMENT = fromString("ConsumptionCommitment"); + /** + * Creates a new instance of LotSource value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LotSource() { + } + /** * Creates or finds a LotSource from its string representation. * @@ -30,7 +39,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/LotSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java index 637c2f110b657..1657e9bd5ecad 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSummary.java @@ -130,6 +130,14 @@ public interface LotSummary { */ Reseller reseller(); + /** + * Gets the isEstimatedBalance property: If true, the listed details are based on an estimation and it will be + * subjected to change. + * + * @return the isEstimatedBalance value. + */ + Boolean isEstimatedBalance(); + /** * Gets the etagPropertiesEtag property: The eTag for the resource. * 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 580dabac15b66..38cbab3558a68 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. */ @@ -28,6 +24,10 @@ public final class Lots { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of Lots class. */ + public Lots() { + } + /** * Get the value property: 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 bab1d91c0f170..a944000537877 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 82433cf0f8663..cd4806323bf6e 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 2743240b9f0b7..8a2d082b55fce 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. */ @@ -31,6 +27,10 @@ public final class MarketplacesListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of MarketplacesListResult class. */ + public MarketplacesListResult() { + } + /** * Get the value property: 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 26cbeec938a64..3659f188b749c 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 */ @@ -22,22 +18,19 @@ public final class MeterDetails { private String meterName; /* - * The category of the meter, for example, 'Cloud services', 'Networking', - * etc.. + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. */ @JsonProperty(value = "meterCategory", access = JsonProperty.Access.WRITE_ONLY) private String meterCategory; /* - * The subcategory of the meter, for example, 'A6 Cloud services', - * 'ExpressRoute (IXP)', etc.. + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */ @JsonProperty(value = "meterSubCategory", access = JsonProperty.Access.WRITE_ONLY) private String meterSubCategory; /* - * The unit in which the meter consumption is charged, for example, - * 'Hours', 'GB', etc. + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. */ @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; @@ -72,6 +65,10 @@ public final class MeterDetails { @JsonProperty(value = "serviceTier", access = JsonProperty.Access.WRITE_ONLY) private String serviceTier; + /** Creates an instance of MeterDetails class. */ + public MeterDetails() { + } + /** * Get the meterName property: 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 9a2fd82709ffb..9a89870f3e612 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 */ @@ -21,22 +17,19 @@ public final class MeterDetailsResponse { private String meterName; /* - * The category of the meter, for example, 'Cloud services', 'Networking', - * etc.. + * The category of the meter, for example, 'Cloud services', 'Networking', etc.. */ @JsonProperty(value = "meterCategory", access = JsonProperty.Access.WRITE_ONLY) private String meterCategory; /* - * The subcategory of the meter, for example, 'A6 Cloud services', - * 'ExpressRoute (IXP)', etc.. + * The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */ @JsonProperty(value = "meterSubCategory", access = JsonProperty.Access.WRITE_ONLY) private String meterSubCategory; /* - * The unit in which the meter consumption is charged, for example, - * 'Hours', 'GB', etc. + * The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. */ @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) private String unitOfMeasure; @@ -47,6 +40,10 @@ public final class MeterDetailsResponse { @JsonProperty(value = "serviceFamily", access = JsonProperty.Access.WRITE_ONLY) private String serviceFamily; + /** Creates an instance of MeterDetailsResponse class. */ + public MeterDetailsResponse() { + } + /** * Get the meterName property: 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 1d6e46c7ce5d1..10a7be9083b2b 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 @@ -19,6 +19,15 @@ public final class Metrictype extends ExpandableStringEnum { /** Static value usage for Metrictype. */ public static final Metrictype USAGE = fromString("usage"); + /** + * Creates a new instance of Metrictype value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Metrictype() { + } + /** * Creates or finds a Metrictype from its string representation. * @@ -30,7 +39,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 d15dcf28111c2..d3e35a2442550 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,14 +16,16 @@ @JsonTypeName("modern") @Fluent public final class ModernChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummary.class); - /* * Properties for modern charge summary */ @JsonProperty(value = "properties", required = true) private ModernChargeSummaryProperties innerProperties = new ModernChargeSummaryProperties(); + /** Creates an instance of ModernChargeSummary class. */ + public ModernChargeSummary() { + } + /** * Get the innerProperties property: Properties for modern charge summary. * @@ -140,6 +141,15 @@ public Boolean isInvoiced() { return this.innerProperties() == null ? null : this.innerProperties().isInvoiced(); } + /** + * Get the subscriptionId property: Subscription guid. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.innerProperties() == null ? null : this.innerProperties().subscriptionId(); + } + /** * Validates the instance. * @@ -149,7 +159,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 +167,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 85f3bd155f595..35be43c3537bd 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 @@ -6,181 +6,44 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.consumption.fluent.models.ModernReservationRecommendationProperties; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import java.util.List; -import java.util.UUID; /** Modern reservation recommendation. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("modern") @Fluent public final class ModernReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendation.class); - /* * Properties for modern reservation recommendation */ @JsonProperty(value = "properties", required = true) - private ModernReservationRecommendationProperties innerProperties = new ModernReservationRecommendationProperties(); - - /** - * Get the innerProperties property: Properties for modern reservation recommendation. - * - * @return the innerProperties value. - */ - private ModernReservationRecommendationProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the location property: Resource Location. - * - * @return the location value. - */ - public String locationPropertiesLocation() { - return this.innerProperties() == null ? null : this.innerProperties().location(); - } - - /** - * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. - * - * @return the lookBackPeriod value. - */ - public Integer lookBackPeriod() { - return this.innerProperties() == null ? null : this.innerProperties().lookBackPeriod(); - } - - /** - * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * - * @return the instanceFlexibilityRatio value. - */ - public Float instanceFlexibilityRatio() { - return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityRatio(); - } - - /** - * Get the instanceFlexibilityGroup property: The instance Flexibility Group. - * - * @return the instanceFlexibilityGroup value. - */ - public String instanceFlexibilityGroup() { - return this.innerProperties() == null ? null : this.innerProperties().instanceFlexibilityGroup(); - } + private ModernReservationRecommendationProperties properties; - /** - * Get the normalizedSize property: The normalized Size. - * - * @return the normalizedSize value. - */ - public String normalizedSize() { - return this.innerProperties() == null ? null : this.innerProperties().normalizedSize(); + /** Creates an instance of ModernReservationRecommendation class. */ + public ModernReservationRecommendation() { } /** - * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. + * Get the properties property: Properties for modern reservation recommendation. * - * @return the recommendedQuantityNormalized value. + * @return the properties value. */ - public Float recommendedQuantityNormalized() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantityNormalized(); + public ModernReservationRecommendationProperties properties() { + return this.properties; } /** - * Get the meterId property: The meter id (GUID). + * Set the properties property: Properties for modern reservation recommendation. * - * @return the meterId value. + * @param properties the properties value to set. + * @return the ModernReservationRecommendation object itself. */ - public UUID meterId() { - return this.innerProperties() == null ? null : this.innerProperties().meterId(); - } - - /** - * Get the term property: RI recommendations in one or three year terms. - * - * @return the term value. - */ - public String term() { - return this.innerProperties() == null ? null : this.innerProperties().term(); - } - - /** - * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. - * - * @return the costWithNoReservedInstances value. - */ - public Amount costWithNoReservedInstances() { - return this.innerProperties() == null ? null : this.innerProperties().costWithNoReservedInstances(); - } - - /** - * Get the recommendedQuantity property: Recommended quality for reserved instances. - * - * @return the recommendedQuantity value. - */ - public BigDecimal recommendedQuantity() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); - } - - /** - * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. - * - * @return the totalCostWithReservedInstances value. - */ - public Amount totalCostWithReservedInstances() { - return this.innerProperties() == null ? null : this.innerProperties().totalCostWithReservedInstances(); - } - - /** - * Get the netSavings property: Total estimated savings with reserved instances. - * - * @return the netSavings value. - */ - public Amount netSavings() { - return this.innerProperties() == null ? null : this.innerProperties().netSavings(); - } - - /** - * Get the firstUsageDate property: The usage date for looking back. - * - * @return the firstUsageDate value. - */ - public OffsetDateTime firstUsageDate() { - return this.innerProperties() == null ? null : this.innerProperties().firstUsageDate(); - } - - /** - * Get the scope property: Shared or single recommendation. - * - * @return the scope value. - */ - public String scope() { - return this.innerProperties() == null ? null : this.innerProperties().scope(); - } - - /** - * Get the skuProperties property: List of sku properties. - * - * @return the skuProperties value. - */ - public List skuProperties() { - return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); - } - - /** - * Get the skuName property: This is the ARM Sku name. - * - * @return the skuName value. - */ - public String skuName() { - return this.innerProperties() == null ? null : this.innerProperties().skuName(); + public ModernReservationRecommendation withProperties(ModernReservationRecommendationProperties properties) { + this.properties = properties; + return this; } /** @@ -191,13 +54,15 @@ public String skuName() { @Override public void validate() { super.validate(); - if (innerProperties() == null) { - throw logger + if (properties() == null) { + throw LOGGER .logExceptionAsError( new IllegalArgumentException( - "Missing required property innerProperties in model ModernReservationRecommendation")); + "Missing required property properties in model ModernReservationRecommendation")); } else { - innerProperties().validate(); + properties().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/fluent/models/ModernReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendationProperties.java similarity index 86% rename from sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationRecommendationProperties.java rename to sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendationProperties.java index 00df5480536b2..da96853b2ba69 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/models/ModernReservationRecommendationProperties.java @@ -2,24 +2,31 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.consumption.fluent.models; +package com.azure.resourcemanager.consumption.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 com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.List; import java.util.UUID; /** The properties of the reservation recommendation. */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "scope", + defaultImpl = ModernReservationRecommendationProperties.class) +@JsonTypeName("ModernReservationRecommendationProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Single", value = ModernSingleScopeReservationRecommendationProperties.class), + @JsonSubTypes.Type(name = "Shared", value = ModernSharedScopeReservationRecommendationProperties.class) +}) @Immutable -public final class ModernReservationRecommendationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendationProperties.class); - +public class ModernReservationRecommendationProperties { /* * Resource Location. */ @@ -80,6 +87,12 @@ public final class ModernReservationRecommendationProperties { @JsonProperty(value = "recommendedQuantity", access = JsonProperty.Access.WRITE_ONLY) private BigDecimal recommendedQuantity; + /* + * Resource type. + */ + @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) + private String resourceType; + /* * The total amount of cost with reserved instances. */ @@ -98,12 +111,6 @@ public final class ModernReservationRecommendationProperties { @JsonProperty(value = "firstUsageDate", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime firstUsageDate; - /* - * Shared or single recommendation. - */ - @JsonProperty(value = "scope", access = JsonProperty.Access.WRITE_ONLY) - private String scope; - /* * List of sku properties */ @@ -116,6 +123,10 @@ public final class ModernReservationRecommendationProperties { @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) private String skuName; + /** Creates an instance of ModernReservationRecommendationProperties class. */ + public ModernReservationRecommendationProperties() { + } + /** * Get the location property: Resource Location. * @@ -206,6 +217,15 @@ public BigDecimal recommendedQuantity() { return this.recommendedQuantity; } + /** + * Get the resourceType property: Resource type. + * + * @return the resourceType value. + */ + public String resourceType() { + return this.resourceType; + } + /** * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. * @@ -233,15 +253,6 @@ public OffsetDateTime firstUsageDate() { return this.firstUsageDate; } - /** - * Get the scope property: Shared or single recommendation. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - /** * Get the skuProperties property: List of sku properties. * 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 47a4683b58478..36655b71f3741 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 77b4c8422ecb4..7da269a114cfc 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. */ @@ -28,6 +24,10 @@ public final class ModernReservationTransactionsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ModernReservationTransactionsListResult class. */ + public ModernReservationTransactionsListResult() { + } + /** * Get the value property: The list of reservation recommendations. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java new file mode 100644 index 0000000000000..582f211b38329 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** The properties of the modern reservation recommendation for shared scope. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scope") +@JsonTypeName("Shared") +@Immutable +public final class ModernSharedScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /** Creates an instance of ModernSharedScopeReservationRecommendationProperties class. */ + public ModernSharedScopeReservationRecommendationProperties() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSingleScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSingleScopeReservationRecommendationProperties.java new file mode 100644 index 0000000000000..beb6bb7920d37 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSingleScopeReservationRecommendationProperties.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.UUID; + +/** The properties of the modern reservation recommendation for single scope. */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scope") +@JsonTypeName("Single") +@Immutable +public final class ModernSingleScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /* + * Subscription ID associated with single scoped recommendation. + */ + @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) + private UUID subscriptionId; + + /** Creates an instance of ModernSingleScopeReservationRecommendationProperties class. */ + public ModernSingleScopeReservationRecommendationProperties() { + } + + /** + * Get the subscriptionId property: Subscription ID associated with single scoped recommendation. + * + * @return the subscriptionId value. + */ + public UUID subscriptionId() { + return this.subscriptionId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + super.validate(); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java index 8d35112b01368..0252a7e95ef2a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernUsageDetail.java @@ -4,11 +4,10 @@ package com.azure.resourcemanager.consumption.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; 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; @@ -19,16 +18,18 @@ /** Modern usage detail. */ @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") @JsonTypeName("modern") -@Fluent +@Immutable public final class ModernUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetail.class); - /* * Properties for modern usage details */ @JsonProperty(value = "properties", required = true) private ModernUsageDetailProperties innerProperties = new ModernUsageDetailProperties(); + /** Creates an instance of ModernUsageDetail class. */ + public ModernUsageDetail() { + } + /** * Get the innerProperties property: Properties for modern usage details. * @@ -731,7 +732,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 +740,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 ac6302aac9a77..f5e6364281cd1 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. */ @@ -29,33 +26,29 @@ public final class Notification { private OperatorType operator; /* - * Threshold value associated with a notification. Notification is sent - * when the cost exceeded the threshold. It is always percent and has to be - * between 0 and 1000. + * Threshold value associated with a notification. Notification is sent when the cost exceeded the threshold. It is + * always percent and has to be between 0 and 1000. */ @JsonProperty(value = "threshold", required = true) private BigDecimal threshold; /* - * Email addresses to send the budget notification to when the threshold is - * exceeded. Must have at least one contact email or contact group - * specified at the Subscription or Resource Group scopes. All other scopes - * must have at least one contact email specified. + * Email addresses to send the budget notification to when the threshold is exceeded. Must have at least one + * contact email or contact group specified at the Subscription or Resource Group scopes. All other scopes must + * have at least one contact email specified. */ @JsonProperty(value = "contactEmails", required = true) private List contactEmails; /* - * Contact roles to send the budget notification to when the threshold is - * exceeded. + * Contact roles to send the budget notification to when the threshold is exceeded. */ @JsonProperty(value = "contactRoles") private List contactRoles; /* - * Action groups to send the budget notification to when the threshold is - * exceeded. Must be provided as a fully qualified Azure resource id. Only - * supported at Subscription or Resource Group scopes. + * Action groups to send the budget notification to when the threshold is exceeded. Must be provided as a fully + * qualified Azure resource id. Only supported at Subscription or Resource Group scopes. */ @JsonProperty(value = "contactGroups") private List contactGroups; @@ -72,6 +65,10 @@ public final class Notification { @JsonProperty(value = "locale") private CultureCode locale; + /** Creates an instance of Notification class. */ + public Notification() { + } + /** * Get the enabled property: 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 b8ba95d212204..9c84b7d9d470f 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. */ @@ -38,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: 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 2c57455a63d5d..aebbf0a0170e4 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,11 +15,8 @@ */ @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. + * List of consumption operations supported by the Microsoft.Consumption resource provider. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; @@ -32,6 +27,10 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of OperationListResult class. */ + public OperationListResult() { + } + /** * Get the value property: 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/OperationStatus.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatus.java new file mode 100644 index 0000000000000..4c0d3df677184 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatus.java @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of OperationStatus. */ +public interface OperationStatus { + /** + * Gets the status property: The status of the long running operation. + * + * @return the status value. + */ + OperationStatusType status(); + + /** + * Gets the downloadUrl property: The link (url) to download the pricesheet. + * + * @return the downloadUrl value. + */ + String downloadUrl(); + + /** + * Gets the validTill property: Download link validity. + * + * @return the validTill value. + */ + OffsetDateTime validTill(); + + /** + * Gets the inner com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner object. + * + * @return the inner object. + */ + OperationStatusInner innerModel(); +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatusType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatusType.java new file mode 100644 index 0000000000000..614f33539c545 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatusType.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** The status of the long running operation. */ +public final class OperationStatusType extends ExpandableStringEnum { + /** Static value Running for OperationStatusType. */ + public static final OperationStatusType RUNNING = fromString("Running"); + + /** Static value Completed for OperationStatusType. */ + public static final OperationStatusType COMPLETED = fromString("Completed"); + + /** Static value Failed for OperationStatusType. */ + public static final OperationStatusType FAILED = fromString("Failed"); + + /** + * Creates a new instance of OperationStatusType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperationStatusType() { + } + + /** + * Creates or finds a OperationStatusType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OperationStatusType. + */ + @JsonCreator + public static OperationStatusType fromString(String name) { + return fromString(name, OperationStatusType.class); + } + + /** + * Gets known OperationStatusType values. + * + * @return known OperationStatusType values. + */ + public static Collection values() { + return values(OperationStatusType.class); + } +} 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 fb678e85b69a2..d95f6ad5ab2f7 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 3646bcb45a455..d088142ae348a 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for OperatorType. */ +/** The comparison operator. */ public final class OperatorType extends ExpandableStringEnum { /** Static value EqualTo for OperatorType. */ public static final OperatorType EQUAL_TO = fromString("EqualTo"); @@ -19,6 +19,15 @@ public final class OperatorType extends ExpandableStringEnum { /** Static value GreaterThanOrEqualTo for OperatorType. */ public static final OperatorType GREATER_THAN_OR_EQUAL_TO = fromString("GreaterThanOrEqualTo"); + /** + * Creates a new instance of OperatorType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OperatorType() { + } + /** * Creates or finds a OperatorType from its string representation. * @@ -30,7 +39,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 b6643e12645f8..b9a95ba3e9e89 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. */ @@ -29,8 +25,7 @@ public final class PriceSheetProperties { private UUID meterId; /* - * The details about the meter. By default this is not populated, unless - * it's specified in $expand. + * The details about the meter. By default this is not populated, unless it's specified in $expand. */ @JsonProperty(value = "meterDetails", access = JsonProperty.Access.WRITE_ONLY) private MeterDetails meterDetails; @@ -71,6 +66,10 @@ public final class PriceSheetProperties { @JsonProperty(value = "offerId", access = JsonProperty.Access.WRITE_ONLY) private String offerId; + /** Creates an instance of PriceSheetProperties class. */ + public PriceSheetProperties() { + } + /** * Get the billingPeriodId property: 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 13bfc45db8b99..2d95d668e42d9 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 @@ -9,6 +9,23 @@ /** Resource collection API of PriceSheets. */ public interface PriceSheets { + /** + * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + * + * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields + * are not included when returning price sheet. + * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that + * specifies a starting point to use for subsequent calls. + * @param top May be used to limit the number of results to the top N results. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the price sheet for a subscription along with {@link Response}. + */ + Response getWithResponse(String expand, String skiptoken, Integer top, Context context); + /** * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. * @@ -19,8 +36,10 @@ public interface PriceSheets { PriceSheetResult get(); /** - * Gets the price sheet for a subscription. Price sheet is available via this API only for May 1, 2014 or later. + * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only + * for May 1, 2014 or later. * + * @param billingPeriodName Billing Period Name. * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields * are not included when returning price sheet. * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response @@ -31,9 +50,10 @@ 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 scope by subscriptionId and billing period along with {@link Response}. */ - Response getWithResponse(String expand, String skiptoken, Integer top, Context context); + Response getByBillingPeriodWithResponse( + String billingPeriodName, String expand, String skiptoken, Integer top, Context context); /** * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only @@ -48,22 +68,27 @@ public interface PriceSheets { PriceSheetResult getByBillingPeriod(String billingPeriodName); /** - * Get the price sheet for a scope by subscriptionId and billing period. Price sheet is available via this API only - * for May 1, 2014 or later. + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. * + * @param billingAccountId BillingAccount ID. + * @param billingPeriodName Billing Period Name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the status of the long running operation. + */ + OperationStatus downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName); + + /** + * Generates the pricesheet for the provided billing period asynchronously based on the enrollment id. + * + * @param billingAccountId BillingAccount ID. * @param billingPeriodName Billing Period Name. - * @param expand May be used to expand the properties/meterDetails within a price sheet. By default, these fields - * are not included when returning price sheet. - * @param skiptoken Skiptoken is only used if a previous operation returned a partial result. If a previous response - * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that - * specifies a starting point to use for subsequent calls. - * @param top May be used to limit the number of results to the top N results. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the price sheet for a scope by subscriptionId and billing period. + * @return the status of the long running operation. */ - Response getByBillingPeriodWithResponse( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context); + OperationStatus downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName, 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 cb9d22a246d8e..74956670e5d27 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for PricingModelType. */ +/** Identifier that indicates how the meter is priced. */ public final class PricingModelType extends ExpandableStringEnum { /** Static value On Demand for PricingModelType. */ public static final PricingModelType ON_DEMAND = fromString("On Demand"); @@ -19,6 +19,15 @@ public final class PricingModelType extends ExpandableStringEnum 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 029cada6fe011..7019f17132b5b 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. */ @@ -26,6 +22,10 @@ public final class Reseller { @JsonProperty(value = "resellerDescription", access = JsonProperty.Access.WRITE_ONLY) private String resellerDescription; + /** Creates an instance of Reseller class. */ + public Reseller() { + } + /** * Get the resellerId property: 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 ffb854c4b8ff5..027973553c460 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. */ @@ -28,6 +24,10 @@ public final class ReservationDetailsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ReservationDetailsListResult class. */ + public ReservationDetailsListResult() { + } + /** * Get the value property: 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 4c93fb135ef73..3992d1d652397 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,45 +12,53 @@ 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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @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 reservation recommendation details. + * @return reservation recommendation details along with {@link Response}. */ - ReservationRecommendationDetailsModel get( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); + Response getWithResponse( + String resourceScope, + Scope scope, + String region, + Term term, + LookBackPeriod lookBackPeriod, + String product, + Context context); /** * 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. * @param product Filter the products for which reservation recommendation results are generated. Examples: * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). - * @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 reservation recommendation details. */ - Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context); + ReservationRecommendationDetailsModel get( + String resourceScope, Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product); } 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 4810f2254a22d..c5dc4cd72e855 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,25 +5,19 @@ 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. */ +/** Details of estimated savings. The costs and savings are estimated for the term. */ @Fluent public final class ReservationRecommendationDetailsCalculatedSavingsProperties { - @JsonIgnore - private final ClientLogger logger = - new ClientLogger(ReservationRecommendationDetailsCalculatedSavingsProperties.class); - /* - * The cost without reservation. + * The cost without reservation. Includes hardware and software cost. */ @JsonProperty(value = "onDemandCost", access = JsonProperty.Access.WRITE_ONLY) private Float onDemandCost; /* - * The difference between total reservation cost and reservation cost. + * Hardware and software cost of the resources not covered by the reservation. */ @JsonProperty(value = "overageCost", access = JsonProperty.Access.WRITE_ONLY) private Float overageCost; @@ -35,32 +29,36 @@ public final class ReservationRecommendationDetailsCalculatedSavingsProperties { private Float quantity; /* - * The exact cost of the estimated usage using reservation. + * Hardware cost of the resources covered by the reservation. */ @JsonProperty(value = "reservationCost", access = JsonProperty.Access.WRITE_ONLY) private Float reservationCost; /* - * The cost of the suggested quantity. + * Reservation cost + software cost of the resources covered by the reservation + overage cost. */ @JsonProperty(value = "totalReservationCost", access = JsonProperty.Access.WRITE_ONLY) private Float totalReservationCost; /* - * The number of reserved units used to calculate savings. Always 1 for - * virtual machines. + * The number of reserved units used to calculate savings. Always 1 for virtual machines. */ @JsonProperty(value = "reservedUnitCount") private Float reservedUnitCount; /* - * The amount saved by purchasing the recommended quantity of reservation. + * The amount saved by purchasing the recommended quantity of reservation. This is equal to onDemandCost - + * totalReservationCost. */ @JsonProperty(value = "savings", access = JsonProperty.Access.WRITE_ONLY) private Float savings; + /** Creates an instance of ReservationRecommendationDetailsCalculatedSavingsProperties class. */ + public ReservationRecommendationDetailsCalculatedSavingsProperties() { + } + /** - * Get the onDemandCost property: The cost without reservation. + * Get the onDemandCost property: The cost without reservation. Includes hardware and software cost. * * @return the onDemandCost value. */ @@ -69,7 +67,7 @@ public Float onDemandCost() { } /** - * Get the overageCost property: The difference between total reservation cost and reservation cost. + * Get the overageCost property: Hardware and software cost of the resources not covered by the reservation. * * @return the overageCost value. */ @@ -87,7 +85,7 @@ public Float quantity() { } /** - * Get the reservationCost property: The exact cost of the estimated usage using reservation. + * Get the reservationCost property: Hardware cost of the resources covered by the reservation. * * @return the reservationCost value. */ @@ -96,7 +94,8 @@ public Float reservationCost() { } /** - * Get the totalReservationCost property: The cost of the suggested quantity. + * Get the totalReservationCost property: Reservation cost + software cost of the resources covered by the + * reservation + overage cost. * * @return the totalReservationCost value. */ @@ -127,7 +126,8 @@ public ReservationRecommendationDetailsCalculatedSavingsProperties withReservedU } /** - * Get the savings property: The amount saved by purchasing the recommended quantity of reservation. + * Get the savings property: The amount saved by purchasing the recommended quantity of reservation. This is equal + * to onDemandCost - totalReservationCost. * * @return the savings value. */ 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 3835bf3903d94..030e5cce327cf 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. */ @@ -23,7 +18,7 @@ public final class ReservationRecommendationDetailsResourceProperties { private List appliedScopes; /* - * On demand rate of the resource. + * Hourly on-demand rate of the resource. Includes only hardware rate i.e, software rate is not included. */ @JsonProperty(value = "onDemandRate", access = JsonProperty.Access.WRITE_ONLY) private Float onDemandRate; @@ -41,7 +36,7 @@ public final class ReservationRecommendationDetailsResourceProperties { private String region; /* - * Reservation rate of the resource. + * Hourly reservation rate of the resource. Varies based on the term. */ @JsonProperty(value = "reservationRate", access = JsonProperty.Access.WRITE_ONLY) private Float reservationRate; @@ -52,6 +47,10 @@ public final class ReservationRecommendationDetailsResourceProperties { @JsonProperty(value = "resourceType", access = JsonProperty.Access.WRITE_ONLY) private String resourceType; + /** Creates an instance of ReservationRecommendationDetailsResourceProperties class. */ + public ReservationRecommendationDetailsResourceProperties() { + } + /** * Get the appliedScopes property: List of subscriptions for which the reservation is applied. * @@ -62,7 +61,8 @@ public List appliedScopes() { } /** - * Get the onDemandRate property: On demand rate of the resource. + * Get the onDemandRate property: Hourly on-demand rate of the resource. Includes only hardware rate i.e, software + * rate is not included. * * @return the onDemandRate value. */ @@ -89,7 +89,7 @@ public String region() { } /** - * Get the reservationRate property: Reservation rate of the resource. + * Get the reservationRate property: Hourly reservation rate of the resource. Varies based on the term. * * @return the reservationRate value. */ 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 7753a58ff4e0c..700baa16fe645 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. */ @@ -23,8 +18,7 @@ public final class ReservationRecommendationDetailsSavingsProperties { private List calculatedSavings; /* - * Number of days of usage to look back used for computing the - * recommendation. + * Number of days of usage to look back used for computing the recommendation. */ @JsonProperty(value = "lookBackPeriod", access = JsonProperty.Access.WRITE_ONLY) private Integer lookBackPeriod; @@ -53,6 +47,10 @@ public final class ReservationRecommendationDetailsSavingsProperties { @JsonProperty(value = "unitOfMeasure", access = JsonProperty.Access.WRITE_ONLY) private String unitOfMeasure; + /** Creates an instance of ReservationRecommendationDetailsSavingsProperties class. */ + public ReservationRecommendationDetailsSavingsProperties() { + } + /** * Get the calculatedSavings property: 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 76d401214b2f0..5a517451b8694 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,27 +5,20 @@ 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. + * The first usage date used for looking back for computing the recommendation. */ @JsonProperty(value = "firstConsumptionDate", access = JsonProperty.Access.WRITE_ONLY) private String firstConsumptionDate; /* - * The last usage date used for looking back for computing the - * recommendation. + * The last usage date used for looking back for computing the recommendation. */ @JsonProperty(value = "lastConsumptionDate", access = JsonProperty.Access.WRITE_ONLY) private String lastConsumptionDate; @@ -37,8 +30,8 @@ public final class ReservationRecommendationDetailsUsageProperties { private String lookBackUnitType; /* - * The breakdown of historical resource usage. The values are in the order - * of usage between the firstConsumptionDate and the lastConsumptionDate. + * The breakdown of historical resource usage. The values are in the order of usage between the + * firstConsumptionDate and the lastConsumptionDate. */ @JsonProperty(value = "usageData", access = JsonProperty.Access.WRITE_ONLY) private List usageData; @@ -49,6 +42,10 @@ public final class ReservationRecommendationDetailsUsageProperties { @JsonProperty(value = "usageGrain", access = JsonProperty.Access.WRITE_ONLY) private String usageGrain; + /** Creates an instance of ReservationRecommendationDetailsUsageProperties class. */ + public ReservationRecommendationDetailsUsageProperties() { + } + /** * Get the firstConsumptionDate property: 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 0111aee932c51..b84811d6008a5 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ReservationRecommendationKind. */ +/** Specifies the kind of reservation recommendation. */ public final class ReservationRecommendationKind extends ExpandableStringEnum { /** Static value legacy for ReservationRecommendationKind. */ public static final ReservationRecommendationKind LEGACY = fromString("legacy"); @@ -16,6 +16,15 @@ public final class ReservationRecommendationKind extends ExpandableStringEnum 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 adae056eabfe6..1470f9fa18912 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 5de354242a737..34723724c0ce2 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. */ @@ -34,6 +30,10 @@ public final class ReservationRecommendationsListResult { @JsonProperty(value = "previousLink", access = JsonProperty.Access.WRITE_ONLY) private String previousLink; + /** Creates an instance of ReservationRecommendationsListResult class. */ + public ReservationRecommendationsListResult() { + } + /** * Get the value property: 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 e355ec17c10d4..70e45f20ae827 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. */ @@ -28,6 +24,10 @@ public final class ReservationSummariesListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ReservationSummariesListResult class. */ + public ReservationSummariesListResult() { + } + /** * Get the value property: 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 c5f47052b7798..7c8989ffd5362 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 16d5361a2471b..8701992ecdbe4 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,22 +6,22 @@ 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. */ @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) private List tags; + /** Creates an instance of ReservationTransactionResource class. */ + public ReservationTransactionResource() { + } + /** * Get the tags property: 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 5fc85b543a975..0d2b97281df89 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 @@ -6,58 +6,87 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; +import java.math.BigDecimal; /** 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 useMarkupIfPartner Applies mark up to the transactions if the caller is a partner. + * @param previewMarkupPercentage Preview markup percentage to be applied. * @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); + PagedIterable list( + String billingAccountId, + String filter, + Boolean useMarkupIfPartner, + BigDecimal previewMarkupPercentage, + 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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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. Note: ARM has a payload size limit of 12MB, so currently callers get 400 when the + * response size exceeds the ARM limit. In such cases, API call should be made with smaller date ranges. * * @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 f79c313d6d236..fdb49eb0cfcfd 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. */ @@ -28,6 +24,10 @@ public final class ReservationTransactionsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of ReservationTransactionsListResult class. */ + public ReservationTransactionsListResult() { + } + /** * Get the value property: 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 0bc6bc3f035af..f4295443f24de 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 @@ -10,7 +10,11 @@ /** Resource collection API of ReservationsDetails. */ public interface ReservationsDetails { /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -18,12 +22,16 @@ 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); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The @@ -32,12 +40,16 @@ 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); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -46,13 +58,17 @@ 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); /** - * Lists the reservations details for provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -62,29 +78,37 @@ 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); /** - * Lists the reservations details for the defined scope and provided date range. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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. + * Lists the reservations details for provided date range. Note: ARM has a payload size limit of 12MB, so currently + * callers get 400 when the response size exceeds the ARM limit. If the data size is too large, customers may also + * get 504 as the API timed out preparing the data. In such cases, API call should be made with smaller date ranges + * or a call to Generate Reservation Details Report API should be made as it is asynchronous and will not run into + * response size time outs. * - * @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 +124,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 a5c07b494c6c8..b644a30feb6e7 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 @@ -10,19 +10,23 @@ /** Resource collection API of ReservationsSummaries. */ public interface ReservationsSummaries { /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param grain Can be daily or monthly. @@ -32,13 +36,15 @@ 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); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -46,13 +52,15 @@ 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); /** - * Lists the reservations summaries for daily or monthly grain. + * Lists the reservations summaries for daily or monthly grain. Note: ARM has a payload size limit of 12MB, so + * currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call should be made + * with smaller date ranges. * * @param reservationOrderId Order Id of the reservation. * @param reservationId Id of the reservation. @@ -63,15 +71,17 @@ 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); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +89,16 @@ 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. + * Lists the reservations summaries for the defined scope daily or monthly grain. Note: ARM has a payload size limit + * of 12MB, so currently callers get 400 when the response size exceeds the ARM limit. In such cases, API call + * should be made with smaller date ranges. * - * @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 +115,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 267f6e808f6a4..3a8d570503e2b 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 */ @@ -26,6 +22,10 @@ public class ResourceAttributes { @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private String sku; + /** Creates an instance of ResourceAttributes class. */ + public ResourceAttributes() { + } + /** * Get the location property: 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 0000000000000..6f3512ee90eff --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java @@ -0,0 +1,47 @@ +// 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 a new instance of Scope value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Scope() { + } + + /** + * 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 5f4126be75357..cf1641c40c7fd 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. */ @@ -26,6 +22,10 @@ public final class SkuProperty { @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private String value; + /** Creates an instance of SkuProperty class. */ + public SkuProperty() { + } + /** * Get the name property: 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 be3cc4f3b9459..9abd00c884621 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Status. */ +/** The status of the lot. */ public final class Status extends ExpandableStringEnum { /** Static value None for Status. */ public static final Status NONE = fromString("None"); @@ -28,6 +28,15 @@ public final class Status extends ExpandableStringEnum { /** Static value Canceled for Status. */ public static final Status CANCELED = fromString("Canceled"); + /** + * Creates a new instance of Status value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Status() { + } + /** * Creates or finds a Status from its string representation. * @@ -39,7 +48,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 1c6eaf790788d..b5cceb723419e 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. */ @@ -27,6 +23,10 @@ public final class Tag { @JsonProperty(value = "value") private List value; + /** Creates an instance of Tag class. */ + public Tag() { + } + /** * Get the key property: 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 45decbb6eebb3..d2d52b265aa66 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 @@ -20,12 +20,13 @@ public interface Tags { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. + * @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 all available tag keys for the defined scope. + * @return all available tag keys for the defined scope along with {@link Response}. */ - TagsResult get(String scope); + Response getWithResponse(String scope, Context context); /** * Get all available tag keys for the defined scope. @@ -38,11 +39,10 @@ public interface Tags { * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for * Management Group scope.. - * @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 all available tag keys for the defined scope. */ - Response getWithResponse(String scope, Context context); + TagsResult get(String scope); } 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 bf14eb811c572..7396ba655db10 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 @@ -16,6 +16,15 @@ public final class Term extends ExpandableStringEnum { /** Static value P3Y for Term. */ public static final Term P3Y = fromString("P3Y"); + /** + * Creates a new instance of Term value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Term() { + } + /** * Creates or finds a Term from its string representation. * @@ -27,7 +36,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 f1a1ee1bb85cb..fe923cab3f7ff 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for ThresholdType. */ +/** The type of threshold. */ public final class ThresholdType extends ExpandableStringEnum { /** Static value Actual for ThresholdType. */ public static final ThresholdType ACTUAL = fromString("Actual"); @@ -16,6 +16,15 @@ public final class ThresholdType extends ExpandableStringEnum { /** Static value Forecasted for ThresholdType. */ public static final ThresholdType FORECASTED = fromString("Forecasted"); + /** + * Creates a new instance of ThresholdType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThresholdType() { + } + /** * Creates or finds a ThresholdType from its string representation. * @@ -27,7 +36,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 2da37ebc4ab5e..95ee5b2637598 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 @@ -8,7 +8,10 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for TimeGrainType. */ +/** + * The time covered by a budget. Tracking of the amount will be reset based on the time grain. BillingMonth, + * BillingQuarter, and BillingAnnual are only supported by WD customers. + */ public final class TimeGrainType extends ExpandableStringEnum { /** Static value Monthly for TimeGrainType. */ public static final TimeGrainType MONTHLY = fromString("Monthly"); @@ -28,6 +31,15 @@ public final class TimeGrainType extends ExpandableStringEnum { /** Static value BillingAnnual for TimeGrainType. */ public static final TimeGrainType BILLING_ANNUAL = fromString("BillingAnnual"); + /** + * Creates a new instance of TimeGrainType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TimeGrainType() { + } + /** * Creates or finds a TimeGrainType from its string representation. * @@ -39,7 +51,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 61734c007e496..96fe6b240409f 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 @@ -13,6 +13,12 @@ public interface UsageDetails { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -26,14 +32,14 @@ public interface UsageDetails { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope); @@ -41,6 +47,12 @@ public interface UsageDetails { * Lists the usage details for the defined scope. Usage details are available via this API only for May 1, 2014 or * later. * + *

**Note:Microsoft will be retiring the Consumption Usage Details API at some point in the future. We do not + * recommend that you take a new dependency on this API. Please use the Cost Details API instead. We will notify + * customers once a date for retirement has been determined.For Learn more,see [Generate Cost Details Report - + * Create + * Operation](https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?tabs=HTTP)**. + * * @param scope The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, @@ -54,9 +66,9 @@ public interface UsageDetails { * for billingAccount scope, * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for * partners. * @param expand May be used to expand the properties/additionalInfo or properties/meterDetails within a list of * usage details. By default, these fields are not included when listing usage details. @@ -74,7 +86,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 7f77f761d22c6..ba37ba146ba9e 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 @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for UsageDetailsKind. */ +/** Specifies the kind of usage details. */ public final class UsageDetailsKind extends ExpandableStringEnum { /** Static value legacy for UsageDetailsKind. */ public static final UsageDetailsKind LEGACY = fromString("legacy"); @@ -16,6 +16,15 @@ public final class UsageDetailsKind extends ExpandableStringEnum 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 928d9f1da0c31..6ee1246bc9458 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. */ @@ -31,6 +27,10 @@ public final class UsageDetailsListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; + /** Creates an instance of UsageDetailsListResult class. */ + public UsageDetailsListResult() { + } + /** * Get the value property: The list of usage details. * diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java index fbea8d1490c7a..17d251a0322c7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetByManagementGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for AggregatedCost GetByManagementGroup. */ public final class AggregatedCostGetByManagementGroupSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroupFilterByDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostByManagementGroupFilterByDate.json */ /** * Sample code: AggregatedCostByManagementGroupFilterByDate. @@ -23,11 +21,11 @@ public static void aggregatedCostByManagementGroupFilterByDate( .getByManagementGroupWithResponse( "managementGroupForTest", "usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostByManagementGroup.json */ /** * Sample code: AggregatedCostByManagementGroup. @@ -36,6 +34,8 @@ public static void aggregatedCostByManagementGroupFilterByDate( */ public static void aggregatedCostByManagementGroup( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + manager + .aggregatedCosts() + .getByManagementGroupWithResponse("managementGroupForTest", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java index f9e11290b568a..50517d2221f79 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/AggregatedCostGetForBillingPeriodByManagementGroupSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json */ /** * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. @@ -20,6 +18,7 @@ public static void aggregatedCostListForBillingPeriodByManagementGroup( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .aggregatedCosts() - .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); + .getForBillingPeriodByManagementGroupWithResponse( + "managementGroupForTest", "201807", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java index 4b788fd036c6c..08b582a403428 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetByBillingAccountSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Balances GetByBillingAccount. */ public final class BalancesGetByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BalancesByBillingAccount.json */ /** * Sample code: Balances. @@ -17,6 +15,6 @@ public final class BalancesGetByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + manager.balances().getByBillingAccountWithResponse("123456", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java index 4d6ec139a0a8b..4f4847319170d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BalancesGetForBillingPeriodByBillingAccountSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Balances GetForBillingPeriodByBillingAccount. */ public final class BalancesGetForBillingPeriodByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BalancesByBillingAccountForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BalancesByBillingAccountForBillingPeriod.json */ /** * Sample code: Balances. @@ -17,6 +15,8 @@ public final class BalancesGetForBillingPeriodByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + manager + .balances() + .getForBillingPeriodByBillingAccountWithResponse("123456", "201702", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java index c76451dc14ee4..747c2b06ca12a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsCreateOrUpdateSamples.java @@ -24,7 +24,7 @@ /** Samples for Budgets CreateOrUpdate. */ public final class BudgetsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreateOrUpdateBudget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/CreateOrUpdateBudget.json */ /** * Sample code: CreateOrUpdateBudget. diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java index 05711c0d6537c..7c5747bda6ff2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsDeleteSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Budgets Delete. */ public final class BudgetsDeleteSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/DeleteBudget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/DeleteBudget.json */ /** * Sample code: DeleteBudget. @@ -19,6 +17,7 @@ public final class BudgetsDeleteSamples { public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .budgets() - .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + .deleteByResourceGroupWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java index 077d0e6279bd1..6368324dbed73 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Budgets Get. */ public final class BudgetsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Budget.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/Budget.json */ /** * Sample code: Budget. @@ -19,6 +17,7 @@ public final class BudgetsGetSamples { public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .budgets() - .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + .getWithResponse( + "subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java index eaf7f20cf4d98..a2d26f3cc9b51 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/BudgetsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Budgets List. */ public final class BudgetsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/BudgetsList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/BudgetsList.json */ /** * Sample code: BudgetsList. @@ -17,6 +15,6 @@ public final class BudgetsListSamples { * @param manager Entry point to ConsumptionManager. */ public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java index d7718f3dd3b74..5bd188aee02db 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ChargesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Charges List. */ public final class ChargesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccount.json */ /** * Sample code: ChargesListByBillingAccount-Modern. @@ -26,11 +24,11 @@ public static void chargesListByBillingAccountModern( "2019-10-31", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. @@ -47,11 +45,11 @@ public static void changesForBillingPeriodByEnrollmentAccountLegacy( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json */ /** * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. @@ -68,11 +66,11 @@ public static void chargesListByBillingAccountGroupByCustomerIdModern( "2019-09-30", null, "groupby((properties/customerId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfile.json */ /** * Sample code: ChargesListByBillingProfile-Modern. @@ -89,11 +87,11 @@ public static void chargesListByBillingProfileModern( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileInvoiceSection.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfileInvoiceSection.json */ /** * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. @@ -110,11 +108,11 @@ public static void chargesListByBillingProfileInvoiceSectionModern( "2019-10-31", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernCustomer.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernCustomer.json */ /** * Sample code: ChargesListByCustomer-Modern. @@ -130,11 +128,11 @@ public static void chargesListByCustomerModern(com.azure.resourcemanager.consump null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForDepartmentFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListForDepartmentFilterByStartEndDate.json */ /** * Sample code: ChargesListByDepartment-Legacy. @@ -150,11 +148,11 @@ public static void chargesListByDepartmentLegacy(com.azure.resourcemanager.consu null, "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json */ /** * Sample code: ChargesListForEnrollmentAccount-Legacy. @@ -171,11 +169,11 @@ public static void chargesListForEnrollmentAccountLegacy( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. @@ -192,11 +190,11 @@ public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( "2019-09-30", null, "groupby((properties/invoiceSectionId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json */ /** * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. @@ -213,11 +211,11 @@ public static void chargesListByBillingAccountGroupByBillingProfileIdModern( "2019-09-30", null, "groupby((properties/billingProfileId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. @@ -234,11 +232,11 @@ public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( "2019-09-30", null, "groupby((properties/invoiceSectionId))", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesForBillingPeriodByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesForBillingPeriodByDepartment.json */ /** * Sample code: ChangesForBillingPeriodByDepartment-Legacy. @@ -255,11 +253,11 @@ public static void changesForBillingPeriodByDepartmentLegacy( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ChargesListByModernInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ChargesListByModernInvoiceSectionId.json */ /** * Sample code: ChargesListByInvoiceSectionId-Modern. @@ -276,6 +274,6 @@ public static void chargesListByInvoiceSectionIdModern( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java index da4b6e0607283..f36519d5fad80 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/CreditsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Credits Get. */ public final class CreditsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/CreditSummaryByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/CreditSummaryByBillingProfile.json */ /** * Sample code: CreditSummaryByBillingProfile. @@ -17,6 +15,6 @@ public final class CreditsGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + manager.credits().getWithResponse("1234:5678", "2468", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java index 9aa86101d18e3..db6ea584916ad 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingAccountSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for EventsOperation ListByBillingAccount. */ public final class EventsOperationListByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsGetByBillingAccount.json */ /** * Sample code: EventsGetByBillingAccount. @@ -17,11 +15,11 @@ public final class EventsOperationListByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.eventsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsGetByBillingAccountWithFilters.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsGetByBillingAccountWithFilters.json */ /** * Sample code: EventsGetByBillingAccountWithFilters. @@ -33,6 +31,8 @@ public static void eventsGetByBillingAccountWithFilters( manager .eventsOperations() .listByBillingAccount( - "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + "1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java index 00f8425f2f709..d2392b172ba47 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/EventsOperationListByBillingProfileSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for EventsOperation ListByBillingProfile. */ public final class EventsOperationListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/EventsListByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EventsListByBillingProfile.json */ /** * Sample code: EventsListByBillingProfile. @@ -17,6 +15,8 @@ public final class EventsOperationListByBillingProfileSamples { * @param manager Entry point to ConsumptionManager. */ public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + manager + .eventsOperations() + .listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java index 690b8b71a5583..c8247920f95e9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingAccountSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for LotsOperation ListByBillingAccount. */ public final class LotsOperationListByBillingAccountSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingAccount.json */ /** * Sample code: LotsListByBillingAccount. @@ -17,11 +15,11 @@ public final class LotsOperationListByBillingAccountSamples { * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingAccountWithFilters.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingAccountWithFilters.json */ /** * Sample code: LotsListByBillingAccountWithStatusFilter. @@ -33,6 +31,8 @@ public static void lotsListByBillingAccountWithStatusFilter( manager .lotsOperations() .listByBillingAccount( - "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + "1234:5678", + "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java index d7b969519c180..721d382d6b047 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByBillingProfileSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for LotsOperation ListByBillingProfile. */ public final class LotsOperationListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/LotsListByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/LotsListByBillingProfile.json */ /** * Sample code: LotsListByBillingProfile. @@ -17,6 +15,6 @@ public final class LotsOperationListByBillingProfileSamples { * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + manager.lotsOperations().listByBillingProfile("1234:5678", "2468", com.azure.core.util.Context.NONE); } } 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 0000000000000..3b562a3f812e3 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +/** Samples for LotsOperation ListByCustomer. */ +public final class LotsOperationListByCustomerSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-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, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-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'", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java index a0a5c0d2dcde3..789ea39b49140 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/MarketplacesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Marketplaces List. */ public final class MarketplacesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json */ /** * Sample code: BillingAccountMarketplacesListForBillingPeriod. @@ -20,11 +18,16 @@ public static void billingAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json */ /** * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. @@ -35,11 +38,16 @@ public static void enrollmentAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/enrollmentAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesList.json */ /** * Sample code: SubscriptionMarketplacesList. @@ -49,11 +57,16 @@ public static void enrollmentAccountMarketplacesListForBillingPeriod( public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByEnrollmentAccountList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByEnrollmentAccountList.json */ /** * Sample code: EnrollmentAccountMarketplacesList. @@ -64,11 +77,16 @@ public static void enrollmentAccountMarketplacesList( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/enrollmentAccounts/123456", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json */ /** * Sample code: DepartmentMarketplacesListForBillingPeriod. @@ -77,11 +95,13 @@ public static void enrollmentAccountMarketplacesList( */ public static void departmentMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + manager + .marketplaces() + .list("providers/Microsoft.Billing/departments/123456", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroupList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByManagementGroupList.json */ /** * Sample code: ManagementGroupMarketplacesList. @@ -92,11 +112,16 @@ public static void managementGroupMarketplacesList( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesListForBillingPeriod.json */ /** * Sample code: SubscriptionMarketplacesListForBillingPeriod. @@ -107,11 +132,16 @@ public static void subscriptionMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByDepartmentList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByDepartmentList.json */ /** * Sample code: DepartmentMarketplacesList. @@ -119,11 +149,13 @@ public static void subscriptionMarketplacesListForBillingPeriod( * @param manager Entry point to ConsumptionManager. */ public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + manager + .marketplaces() + .list("providers/Microsoft.Billing/departments/123456", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json */ /** * Sample code: ManagementGroupMarketplacesListForBillingPeriod. @@ -134,11 +166,16 @@ public static void managementGroupMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/MarketplacesByBillingAccountList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/MarketplacesByBillingAccountList.json */ /** * Sample code: BillingAccountMarketplacesList. @@ -149,6 +186,11 @@ public static void billingAccountMarketplacesList( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456", + null, + null, + null, + com.azure.core.util.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 0000000000000..d14e8641f1b35 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +/** Samples for Operations List. */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/OperationList.json + */ + /** + * Sample code: OperationList. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void operationList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetDownloadByBillingAccountPeriodSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetDownloadByBillingAccountPeriodSamples.java new file mode 100644 index 0000000000000..8234cfa92d1a7 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetDownloadByBillingAccountPeriodSamples.java @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +/** Samples for PriceSheet DownloadByBillingAccountPeriod. */ +public final class PriceSheetDownloadByBillingAccountPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/EAPriceSheetForBillingPeriod.json + */ + /** + * Sample code: EAPriceSheetForBillingPeriod. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eAPriceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.priceSheets().downloadByBillingAccountPeriod("0000000", "202305", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java index 2fd13c9b68945..4c065369542e2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetByBillingPeriodSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for PriceSheet GetByBillingPeriod. */ public final class PriceSheetGetByBillingPeriodSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheetForBillingPeriod.json */ /** * Sample code: PriceSheetForBillingPeriod. @@ -17,11 +15,13 @@ public final class PriceSheetGetByBillingPeriodSamples { * @param manager Entry point to ConsumptionManager. */ public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + manager + .priceSheets() + .getByBillingPeriodWithResponse("201801", null, null, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheetExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheetExpand.json */ /** * Sample code: PriceSheetExpand. @@ -29,6 +29,8 @@ public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumpt * @param manager Entry point to ConsumptionManager. */ public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + manager + .priceSheets() + .getByBillingPeriodWithResponse("201801", "meterDetails", null, null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java index 89d4b805d63e0..07f378df4ba13 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for PriceSheet Get. */ public final class PriceSheetGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/PriceSheet.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/PriceSheet.json */ /** * Sample code: PriceSheet. @@ -17,6 +15,6 @@ public final class PriceSheetGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getWithResponse(null, null, null, Context.NONE); + manager.priceSheets().getWithResponse(null, null, null, com.azure.core.util.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 6ea6dcad3a88c..f0e8cf0dc2c1d 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 @@ -4,14 +4,14 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.LookBackPeriod; +import com.azure.resourcemanager.consumption.models.Scope; import com.azure.resourcemanager.consumption.models.Term; /** Samples for ReservationRecommendationDetails Get. */ public final class ReservationRecommendationDetailsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsBySubscription.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. @@ -22,11 +22,18 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. @@ -38,11 +45,17 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByResourceGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. @@ -53,11 +66,18 @@ 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", + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationDetailsByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationDetailsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. @@ -68,6 +88,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", + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java index 138e5e91c8942..64bc811ca60c5 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationRecommendationsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for ReservationRecommendations List. */ public final class ReservationRecommendationsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsBySubscription.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. @@ -20,11 +18,11 @@ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. @@ -35,11 +33,14 @@ public static void reservationRecommendationsByBillingProfileModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); + .list( + "providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByResourceGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. @@ -50,11 +51,14 @@ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json */ /** * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. @@ -68,11 +72,11 @@ public static void reservationRecommendationsFilterBySubscriptionForScopeLookBac .list( "subscriptions/00000000-0000-0000-0000-000000000000", "properties/scope eq 'Single' AND properties/lookBackPeriod eq 'Last7Days'", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationRecommendationsByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationRecommendationsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. @@ -83,6 +87,6 @@ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); + .list("providers/Microsoft.Billing/billingAccounts/123456", null, com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java index 2df7af00151fb..fe31884f0ddd4 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListByBillingProfileSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for ReservationTransactions ListByBillingProfile. */ public final class ReservationTransactionsListByBillingProfileSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationTransactionsListByBillingProfileId.json */ /** * Sample code: ReservationTransactionsByBillingProfileId. @@ -24,6 +22,6 @@ public static void reservationTransactionsByBillingProfileId( "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", "Z76D-SGAF-BG7-TGB", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java index c1225f41c2a42..eaf83db465e7e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationTransactionsListSamples.java @@ -4,12 +4,12 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; +import java.math.BigDecimal; /** Samples for ReservationTransactions List. */ public final class ReservationTransactionsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationTransactionsListByEnrollmentNumber.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationTransactionsListByEnrollmentNumber.json */ /** * Sample code: ReservationTransactionsByEnrollmentNumber. @@ -20,6 +20,11 @@ public static void reservationTransactionsByEnrollmentNumber( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationTransactions() - .list("123456", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", Context.NONE); + .list( + "123456", + "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", + true, + new BigDecimal("15.5"), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java index 3207aa8e90169..fd22a3574d7f9 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderAndReservationSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ public final class ReservationsDetailsListByReservationOrderAndReservationSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsWithReservationId.json */ /** * Sample code: ReservationDetailsWithReservationId. @@ -24,6 +22,6 @@ public static void reservationDetailsWithReservationId( "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java index 5a3ac3508b852..25ab73a7e4f2b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListByReservationOrderSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for ReservationsDetails ListByReservationOrder. */ public final class ReservationsDetailsListByReservationOrderSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetails.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetails.json */ /** * Sample code: ReservationDetails. @@ -22,6 +20,6 @@ public static void reservationDetails(com.azure.resourcemanager.consumption.Cons .listByReservationOrder( "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java index 94c739663dee7..83abf07b4e99d 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsDetailsListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for ReservationsDetails List. */ public final class ReservationsDetailsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingProfileIdReservationId.json */ /** * Sample code: ReservationDetailsByBillingProfileIdReservationId. @@ -27,11 +25,11 @@ public static void reservationDetailsByBillingProfileIdReservationId( null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingAccountId.json */ /** * Sample code: ReservationDetailsByBillingAccountId. @@ -49,11 +47,11 @@ public static void reservationDetailsByBillingAccountId( "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationDetailsByBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationDetailsByBillingProfileId.json */ /** * Sample code: ReservationDetailsByBillingProfileId. @@ -71,6 +69,6 @@ public static void reservationDetailsByBillingProfileId( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java index cf09a00f17e5f..9ef294ae92431 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderAndReservationSamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ public final class ReservationsSummariesListByReservationOrderAndReservationSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithReservationId.json */ /** * Sample code: ReservationSummariesDailyWithReservationId. @@ -26,11 +25,11 @@ public static void reservationSummariesDailyWithReservationId( "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithReservationId. @@ -46,6 +45,6 @@ public static void reservationSummariesMonthlyWithReservationId( "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java index d5b722788fbd5..80fc387fb096a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListByReservationOrderSamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries ListByReservationOrder. */ public final class ReservationsSummariesListByReservationOrderSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthly.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthly.json */ /** * Sample code: ReservationSummariesMonthly. @@ -20,11 +19,12 @@ public final class ReservationsSummariesListByReservationOrderSamples { public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .reservationsSummaries() - .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); + .listByReservationOrder( + "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDaily.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDaily.json */ /** * Sample code: ReservationSummariesDaily. @@ -38,6 +38,6 @@ public static void reservationSummariesDaily(com.azure.resourcemanager.consumpti "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java index 7289882cd5a34..07459802f9c69 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/ReservationsSummariesListSamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; /** Samples for ReservationsSummaries List. */ public final class ReservationsSummariesListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesDailyWithBillingAccountId. @@ -29,11 +28,11 @@ public static void reservationSummariesDailyWithBillingAccountId( "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesDailyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesDailyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesDailyWithBillingProfileId. @@ -52,11 +51,11 @@ public static void reservationSummariesDailyWithBillingProfileId( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingAccountId. @@ -75,11 +74,11 @@ public static void reservationSummariesMonthlyWithBillingAccountId( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileId. @@ -98,11 +97,11 @@ public static void reservationSummariesMonthlyWithBillingProfileId( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. @@ -121,6 +120,6 @@ public static void reservationSummariesMonthlyWithBillingProfileIdReservationId( null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java index be0a881edbe4b..77c66c769db4f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/TagsGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - /** Samples for Tags Get. */ public final class TagsGetSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/Tags.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/Tags.json */ /** * Sample code: Tags_Get. @@ -17,6 +15,9 @@ public final class TagsGetSamples { * @param manager Entry point to ConsumptionManager. */ public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + manager + .tags() + .getWithResponse( + "providers/Microsoft.CostManagement/billingAccounts/1234", com.azure.core.util.Context.NONE); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java index 3286358ace126..cc0dae3fa74e8 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/UsageDetailsListSamples.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Metrictype; /** Samples for UsageDetails List. */ public final class UsageDetailsListSamples { /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. @@ -21,11 +20,18 @@ public static void billingAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCAInvoiceSection.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCAInvoiceSection.json */ /** * Sample code: InvoiceSectionUsageDetailsList-Modern. @@ -43,11 +49,11 @@ public static void invoiceSectionUsageDetailsListModern( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsList.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsList.json */ /** * Sample code: UsageDetailsList-Legacy. @@ -57,11 +63,18 @@ public static void invoiceSectionUsageDetailsListModern( public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListFilterByTag.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListFilterByTag.json */ /** * Sample code: UsageDetailsListFilterByTag-Legacy. @@ -79,11 +92,11 @@ public static void usageDetailsListFilterByTagLegacy( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByBillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Legacy. @@ -94,11 +107,18 @@ public static void billingAccountUsageDetailsListLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingProfile.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCABillingProfile.json */ /** * Sample code: BillingProfileUsageDetailsList-Modern. @@ -116,11 +136,11 @@ public static void billingProfileUsageDetailsListModern( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByDepartment.json */ /** * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. @@ -131,11 +151,18 @@ public static void departmentUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/Departments/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. @@ -146,11 +173,18 @@ public static void managementGroupUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricAmortizedCost.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricAmortizedCost.json */ /** * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. @@ -168,11 +202,11 @@ public static void usageDetailsListByMetricAmortizedCostLegacy( null, null, Metrictype.AMORTIZEDCOST, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricUsage.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricUsage.json */ /** * Sample code: UsageDetailsListByMetricUsage-Legacy. @@ -190,11 +224,11 @@ public static void usageDetailsListByMetricUsageLegacy( null, null, Metrictype.USAGE, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByManagementGroup.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsList-Legacy. @@ -205,11 +239,18 @@ public static void managementGroupUsageDetailsListLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByDepartment.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByDepartment.json */ /** * Sample code: DepartmentUsageDetailsList-Legacy. @@ -220,11 +261,18 @@ public static void departmentUsageDetailsListLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/Departments/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMetricActualCost.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMetricActualCost.json */ /** * Sample code: UsageDetailsListByMetricActualCost-Legacy. @@ -242,11 +290,11 @@ public static void usageDetailsListByMetricActualCostLegacy( null, null, Metrictype.ACTUALCOST, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsList-Legacy. @@ -257,11 +305,18 @@ public static void enrollmentAccountUsageDetailsListLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/EnrollmentAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCABillingAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCABillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Modern. @@ -272,11 +327,18 @@ public static void billingAccountUsageDetailsListModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/BillingAccounts/1234:56789", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListByMCACustomer.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListByMCACustomer.json */ /** * Sample code: CustomerUsageDetailsList-Modern. @@ -294,11 +356,11 @@ public static void customerUsageDetailsListModern( null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsExpand.json */ /** * Sample code: UsageDetailsExpand-Legacy. @@ -315,11 +377,11 @@ public static void usageDetailsExpandLegacy(com.azure.resourcemanager.consumptio null, 1, null, - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. @@ -330,11 +392,18 @@ public static void enrollmentAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + .list( + "providers/Microsoft.Billing/EnrollmentAccounts/1234", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2021-10-01/examples/UsageDetailsListForBillingPeriod.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-03-01/examples/UsageDetailsListForBillingPeriod.json */ /** * Sample code: UsageDetailsListForBillingPeriod-Legacy. @@ -345,6 +414,13 @@ public static void usageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { manager .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + .list( + "subscriptions/00000000-0000-0000-0000-000000000000", + null, + null, + null, + null, + null, + com.azure.core.util.Context.NONE); } }