diff --git a/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md b/sdk/consumption/azure-resourcemanager-consumption/CHANGELOG.md index b713d35da2ba..ddc057c16d56 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 (2024-05-07) + +- 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-11. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/consumption/azure-resourcemanager-consumption/README.md b/sdk/consumption/azure-resourcemanager-consumption/README.md index 4bc0fe107d50..582e1145e3c3 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-11. 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, Microsoft Entra ID 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,20 +83,25 @@ 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 [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [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/ + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-java%2Fsdk%2Fconsumption%2Fazure-resourcemanager-consumption%2FREADME.png) diff --git a/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md b/sdk/consumption/azure-resourcemanager-consumption/SAMPLE.md index a96cb65e9053..fb67aa7a4e2f 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,39 +86,38 @@ ### AggregatedCost_GetByManagementGroup ```java -import com.azure.core.util.Context; - -/** Samples for AggregatedCost GetByManagementGroup. */ +/** + * 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-11-01/examples/AggregatedCostByManagementGroupFilterByDate.json */ /** * Sample code: AggregatedCostByManagementGroupFilterByDate. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void aggregatedCostByManagementGroupFilterByDate( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .aggregatedCosts() - .getByManagementGroupWithResponse( - "managementGroupForTest", + public static void + aggregatedCostByManagementGroupFilterByDate(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.aggregatedCosts() + .getByManagementGroupWithResponse("managementGroupForTest", "usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'", - Context.NONE); + 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-11-01/examples/AggregatedCostByManagementGroup.json */ /** * Sample code: AggregatedCostByManagementGroup. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void aggregatedCostByManagementGroup( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + public static void + aggregatedCostByManagementGroup(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.aggregatedCosts() + .getByManagementGroupWithResponse("managementGroupForTest", null, com.azure.core.util.Context.NONE); } } ``` @@ -120,23 +125,23 @@ public final class AggregatedCostGetByManagementGroupSamples { ### AggregatedCost_GetForBillingPeriodByManagementGroup ```java -import com.azure.core.util.Context; - -/** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ +/** + * 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-11-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json */ /** * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. - * + * * @param manager Entry point to ConsumptionManager. */ public static void aggregatedCostListForBillingPeriodByManagementGroup( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .aggregatedCosts() - .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); + manager.aggregatedCosts() + .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", + com.azure.core.util.Context.NONE); } } ``` @@ -144,20 +149,20 @@ public final class AggregatedCostGetForBillingPeriodByManagementGroupSamples { ### Balances_GetByBillingAccount ```java -import com.azure.core.util.Context; - -/** Samples for Balances GetByBillingAccount. */ +/** + * 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-11-01/examples/BalancesByBillingAccount.json */ /** * Sample code: Balances. - * + * * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + manager.balances().getByBillingAccountWithResponse("123456", com.azure.core.util.Context.NONE); } } ``` @@ -165,20 +170,21 @@ public final class BalancesGetByBillingAccountSamples { ### Balances_GetForBillingPeriodByBillingAccount ```java -import com.azure.core.util.Context; - -/** Samples for Balances GetForBillingPeriodByBillingAccount. */ +/** + * 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-11-01/examples/BalancesByBillingAccountForBillingPeriod.json */ /** * Sample code: Balances. - * + * * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + manager.balances() + .getForBillingPeriodByBillingAccountWithResponse("123456", "201702", com.azure.core.util.Context.NONE); } } ``` @@ -203,74 +209,53 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; -/** Samples for Budgets CreateOrUpdate. */ +/** + * 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-11-01/examples/CreateOrUpdateBudget.json */ /** * Sample code: CreateOrUpdateBudget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void createOrUpdateBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() + manager.budgets() .define("TestBudget") .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") .withEtag("\"1d34d016a593709\"") .withCategory(CategoryType.COST) .withAmount(new BigDecimal("100.65")) .withTimeGrain(TimeGrainType.MONTHLY) - .withTimePeriod( - new BudgetTimePeriod() - .withStartDate(OffsetDateTime.parse("2017-10-01T00:00:00Z")) - .withEndDate(OffsetDateTime.parse("2018-10-31T00:00:00Z"))) - .withFilter( - new BudgetFilter() - .withAnd( - Arrays - .asList( - new BudgetFilterProperties() - .withDimensions( - new BudgetComparisonExpression() - .withName("ResourceId") - .withOperator(BudgetOperatorType.IN) - .withValues( - Arrays - .asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), - new BudgetFilterProperties() - .withTags( - new BudgetComparisonExpression() - .withName("category") - .withOperator(BudgetOperatorType.IN) - .withValues(Arrays.asList("Dev", "Prod"))), - new BudgetFilterProperties() - .withTags( - new BudgetComparisonExpression() - .withName("department") - .withOperator(BudgetOperatorType.IN) - .withValues(Arrays.asList("engineering", "sales")))))) - .withNotifications( - mapOf( - "Actual_GreaterThan_80_Percent", - new Notification() - .withEnabled(true) - .withOperator(OperatorType.GREATER_THAN) - .withThreshold(new BigDecimal("80")) - .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) - .withContactRoles(Arrays.asList("Contributor", "Reader")) - .withContactGroups( - Arrays - .asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) - .withThresholdType(ThresholdType.ACTUAL) - .withLocale(CultureCode.EN_US))) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2017-10-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2018-10-31T00:00:00Z"))) + .withFilter(new BudgetFilter().withAnd(Arrays.asList( + new BudgetFilterProperties().withDimensions(new BudgetComparisonExpression().withName("ResourceId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("category") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("Dev", "Prod"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("department") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("engineering", "sales")))))) + .withNotifications(mapOf("Actual_GreaterThan_80_Percent", new Notification().withEnabled(true) + .withOperator(OperatorType.GREATER_THAN) + .withThreshold(new BigDecimal("80")) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withContactRoles(Arrays.asList("Contributor", "Reader")) + .withContactGroups(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.EN_US))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); @@ -287,22 +272,22 @@ public final class BudgetsCreateOrUpdateSamples { ### Budgets_Delete ```java -import com.azure.core.util.Context; - -/** Samples for Budgets Delete. */ +/** + * 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-11-01/examples/DeleteBudget.json */ /** * Sample code: DeleteBudget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() - .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + manager.budgets() + .deleteByResourceGroupWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", + com.azure.core.util.Context.NONE); } } ``` @@ -310,22 +295,22 @@ public final class BudgetsDeleteSamples { ### Budgets_Get ```java -import com.azure.core.util.Context; - -/** Samples for Budgets Get. */ +/** + * 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-11-01/examples/Budget.json */ /** * Sample code: Budget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() - .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + manager.budgets() + .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", + com.azure.core.util.Context.NONE); } } ``` @@ -333,20 +318,20 @@ public final class BudgetsGetSamples { ### Budgets_List ```java -import com.azure.core.util.Context; - -/** Samples for Budgets List. */ +/** + * 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-11-01/examples/BudgetsList.json */ /** * Sample code: BudgetsList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", com.azure.core.util.Context.NONE); } } ``` @@ -354,279 +339,204 @@ public final class BudgetsListSamples { ### Charges_List ```java -import com.azure.core.util.Context; - -/** Samples for Charges List. */ +/** + * 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-11-01/examples/ChargesListByModernBillingAccount.json */ /** * Sample code: ChargesListByBillingAccount-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByBillingAccountModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-10-31", - null, - null, - Context.NONE); + public static void + chargesListByBillingAccountModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-10-31", + null, null, 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-11-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void changesForBillingPeriodByEnrollmentAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", - null, - null, - null, - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", 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/ChargesListByModernBillingAccountGroupByCustomerId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json */ /** * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByCustomerIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/customerId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-09-30", + null, "groupby((properties/customerId))", 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-11-01/examples/ChargesListByModernBillingProfile.json */ /** * Sample code: ChargesListByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByBillingProfileModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListByBillingProfileModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", null, null, + null, null, 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-11-01/examples/ChargesListByModernBillingProfileInvoiceSection.json */ /** * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileInvoiceSectionModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() + manager.charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425/invoiceSections/67890", - "2019-09-01", - "2019-10-31", - null, - null, - Context.NONE); + "2019-09-01", "2019-10-31", null, null, 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-11-01/examples/ChargesListByModernCustomer.json */ /** * Sample code: ChargesListByCustomer-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByCustomerModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", - null, - null, - null, - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", 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/ChargesListForDepartmentFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListForDepartmentFilterByStartEndDate.json */ /** * Sample code: ChargesListByDepartment-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", - null, - null, - "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", null, null, + "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", null, 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-11-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json */ /** * Sample code: ChargesListForEnrollmentAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListForEnrollmentAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListForEnrollmentAccountLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", 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/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/invoiceSectionId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", "2019-09-30", null, "groupby((properties/invoiceSectionId))", + 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-11-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json */ /** * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByBillingProfileIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/billingProfileId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-09-30", + null, "groupby((properties/billingProfileId))", 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-11-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/invoiceSectionId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", "2019-09-30", null, "groupby((properties/invoiceSectionId))", + 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-11-01/examples/ChargesForBillingPeriodByDepartment.json */ /** * Sample code: ChangesForBillingPeriodByDepartment-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void changesForBillingPeriodByDepartmentLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", - null, - null, - null, - null, - Context.NONE); + public static void + changesForBillingPeriodByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", 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/ChargesListByModernInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernInvoiceSectionId.json */ /** * Sample code: ChargesListByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByInvoiceSectionIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListByInvoiceSectionIdModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", null, + null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -634,20 +544,20 @@ public final class ChargesListSamples { ### Credits_Get ```java -import com.azure.core.util.Context; - -/** Samples for Credits Get. */ +/** + * 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-11-01/examples/CreditSummaryByBillingProfile.json */ /** * Sample code: CreditSummaryByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + manager.credits().getWithResponse("1234:5678", "2468", com.azure.core.util.Context.NONE); } } ``` @@ -655,36 +565,94 @@ public final class CreditsGetSamples { ### EventsOperation_ListByBillingAccount ```java -import com.azure.core.util.Context; - -/** Samples for EventsOperation ListByBillingAccount. */ +/** + * 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-11-01/examples/EventsGetByBillingAccount-Primary.json + */ + /** + * Sample code: EventsGetByBillingAccount-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccountWithFilters-Primary.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountWithFiltersPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccount.json */ /** * Sample code: EventsGetByBillingAccount. - * + * * @param manager Entry point to ConsumptionManager. */ public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + 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-11-01/examples/EventsGetByBillingAccountWithFilters.json */ /** * Sample code: EventsGetByBillingAccountWithFilters. - * + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountWithFilters(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccountWithFilters-Contributor.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters-Contributor.json. + * * @param manager Entry point to ConsumptionManager. */ - public static void eventsGetByBillingAccountWithFilters( + public static void eventsGetByBillingAccountWithFiltersContributorJson( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .eventsOperations() - .listByBillingAccount( - "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccount-Contributor.json + */ + /** + * Sample code: EventsGetByBillingAccount-Contributor. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountContributor(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); } } ``` @@ -692,20 +660,21 @@ public final class EventsOperationListByBillingAccountSamples { ### EventsOperation_ListByBillingProfile ```java -import com.azure.core.util.Context; - -/** Samples for EventsOperation ListByBillingProfile. */ +/** + * 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-11-01/examples/EventsListByBillingProfile.json */ /** * Sample code: EventsListByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + manager.eventsOperations() + .listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", com.azure.core.util.Context.NONE); } } ``` @@ -713,36 +682,91 @@ public final class EventsOperationListByBillingProfileSamples { ### LotsOperation_ListByBillingAccount ```java -import com.azure.core.util.Context; - -/** Samples for LotsOperation ListByBillingAccount. */ +/** + * 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-11-01/examples/LotsListByBillingAccount.json */ /** * Sample code: LotsListByBillingAccount. - * + * * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccount-Primary.json + */ + /** + * Sample code: LotsListByBillingAccount-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + 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-11-01/examples/LotsListByBillingAccountWithFilters.json */ /** * Sample code: LotsListByBillingAccountWithStatusFilter. - * + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountWithStatusFilter(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations() + .listByBillingAccount("1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccount-Contributor.json + */ + /** + * Sample code: LotsListByBillingAccount-Contributor. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountContributor(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccountWithFilters-Primary.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccountWithStatusFilterPrimary( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations() + .listByBillingAccount("1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccountWithFilters-Contributor.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter-Contributor. + * * @param manager Entry point to ConsumptionManager. */ - public static void lotsListByBillingAccountWithStatusFilter( + public static void lotsListByBillingAccountWithStatusFilterContributor( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .lotsOperations() - .listByBillingAccount( - "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + manager.lotsOperations() + .listByBillingAccount("1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); } } ``` @@ -750,194 +774,273 @@ public final class LotsOperationListByBillingAccountSamples { ### LotsOperation_ListByBillingProfile ```java -import com.azure.core.util.Context; - -/** Samples for LotsOperation ListByBillingProfile. */ +/** + * 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-11-01/examples/LotsListByBillingProfile.json */ /** * Sample code: LotsListByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + 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-11-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-11-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 -/** Samples for 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-11-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json */ /** * Sample code: BillingAccountMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void billingAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json */ /** * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesList.json */ /** * Sample code: SubscriptionMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByEnrollmentAccountList.json */ /** * Sample code: EnrollmentAccountMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void enrollmentAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + public static void + enrollmentAccountMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json */ /** * Sample code: DepartmentMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void departmentMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + public static void + departmentMarketplacesListForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + 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-11-01/examples/MarketplacesByManagementGroupList.json */ /** * Sample code: ManagementGroupMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void managementGroupMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + public static void + managementGroupMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesListForBillingPeriod.json */ /** * Sample code: SubscriptionMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void subscriptionMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + public static void + subscriptionMarketplacesListForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesByDepartmentList.json */ /** * Sample code: DepartmentMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + 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-11-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json */ /** * Sample code: ManagementGroupMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void managementGroupMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByBillingAccountList.json */ /** * Sample code: BillingAccountMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + public static void + billingAccountMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, + com.azure.core.util.Context.NONE); } } ``` -### PriceSheet_Get +### Operations_List + +```java +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-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 -import com.azure.core.util.Context; +/** + * Samples for PriceSheet DownloadByBillingAccountPeriod. + */ +public final class PriceSheetDownloadByBillingAccountPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-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); + } +} +``` -/** Samples for PriceSheet Get. */ +### 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-11-01/examples/PriceSheet.json */ /** * Sample code: PriceSheet. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getWithResponse(null, null, null, Context.NONE); + manager.priceSheets().getWithResponse(null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -945,32 +1048,34 @@ public final class PriceSheetGetSamples { ### PriceSheet_GetByBillingPeriod ```java -import com.azure.core.util.Context; - -/** Samples for PriceSheet GetByBillingPeriod. */ +/** + * 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-11-01/examples/PriceSheetForBillingPeriod.json */ /** * Sample code: PriceSheetForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + 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-11-01/examples/PriceSheetExpand.json */ /** * Sample code: PriceSheetExpand. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + manager.priceSheets() + .getByBillingPeriodWithResponse("201801", "meterDetails", null, null, com.azure.core.util.Context.NONE); } } ``` @@ -978,71 +1083,76 @@ 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. */ +/** + * 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-11-01/examples/ReservationRecommendationDetailsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("subscriptions/00000000-0000-0000-0000-00000000", Scope.SINGLE, "westus", Term.P3Y, + LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", null, 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-11-01/examples/ReservationRecommendationDetailsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingProfileModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() + 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", + "properties/subscriptionId eq 00000000-0000-0000-0000-00000000", 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-11-01/examples/ReservationRecommendationDetailsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup", Scope.SINGLE, + "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", null, + 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-11-01/examples/ReservationRecommendationDetailsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("providers/Microsoft.Billing/billingAccounts/00000000", Scope.SHARED, "eastus", Term.P1Y, + LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", + "properties/subscriptionId eq 00000000-0000-0000-0000-00000000", com.azure.core.util.Context.NONE); } } ``` @@ -1050,86 +1160,82 @@ public final class ReservationRecommendationDetailsGetSamples { ### ReservationRecommendations_List ```java -import com.azure.core.util.Context; - -/** Samples for ReservationRecommendations List. */ +/** + * 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-11-01/examples/ReservationRecommendationsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingProfileModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json */ /** * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); + manager.reservationRecommendations() + .list("providers/Microsoft.Billing/billingAccounts/123456", null, com.azure.core.util.Context.NONE); } } ``` @@ -1137,23 +1243,25 @@ public final class ReservationRecommendationsListSamples { ### ReservationTransactions_List ```java -import com.azure.core.util.Context; +import java.math.BigDecimal; -/** Samples for ReservationTransactions List. */ +/** + * 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-11-01/examples/ReservationTransactionsListByEnrollmentNumber.json */ /** * Sample code: ReservationTransactionsByEnrollmentNumber. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationTransactionsByEnrollmentNumber( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationTransactions() - .list("123456", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", Context.NONE); + 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", true, + new BigDecimal("15.5"), com.azure.core.util.Context.NONE); } } ``` @@ -1161,27 +1269,25 @@ public final class ReservationTransactionsListSamples { ### ReservationTransactions_ListByBillingProfile ```java -import com.azure.core.util.Context; - -/** Samples for ReservationTransactions ListByBillingProfile. */ +/** + * 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-11-01/examples/ReservationTransactionsListByBillingProfileId.json */ /** * Sample code: ReservationTransactionsByBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationTransactionsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationTransactions() + public static void + reservationTransactionsByBillingProfileId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationTransactions() .listByBillingProfile( "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", - "Z76D-SGAF-BG7-TGB", - "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", - Context.NONE); + "Z76D-SGAF-BG7-TGB", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", + com.azure.core.util.Context.NONE); } } ``` @@ -1189,74 +1295,55 @@ public final class ReservationTransactionsListByBillingProfileSamples { ### ReservationsDetails_List ```java -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails List. */ +/** + * 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-11-01/examples/ReservationDetailsByBillingProfileIdReservationId.json */ /** * Sample code: ReservationDetailsByBillingProfileIdReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsByBillingProfileIdReservationId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - "2019-09-01", - "2019-10-31", - null, - "1c6b6358-709f-484c-85f1-72e862a0cf3b", - "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", "2019-09-01", + "2019-10-31", null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + 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-11-01/examples/ReservationDetailsByBillingAccountId.json */ /** * Sample code: ReservationDetailsByBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsByBillingAccountId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - null, - null, - "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - null, - null, - Context.NONE); + public static void + reservationDetailsByBillingAccountId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345", null, null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", null, null, + 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-11-01/examples/ReservationDetailsByBillingProfileId.json */ /** * Sample code: ReservationDetailsByBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - "2019-09-01", - "2019-10-31", - null, - null, - null, - Context.NONE); + public static void + reservationDetailsByBillingProfileId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", "2019-09-01", + "2019-10-31", null, null, null, com.azure.core.util.Context.NONE); } } ``` @@ -1264,25 +1351,23 @@ public final class ReservationsDetailsListSamples { ### ReservationsDetails_ListByReservationOrder ```java -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails ListByReservationOrder. */ +/** + * 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-11-01/examples/ReservationDetails.json */ /** * Sample code: ReservationDetails. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationDetails(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .listByReservationOrder( - "00000000-0000-0000-0000-000000000000", + manager.reservationsDetails() + .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,27 +1375,25 @@ public final class ReservationsDetailsListByReservationOrderSamples { ### ReservationsDetails_ListByReservationOrderAndReservation ```java -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ +/** + * 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-11-01/examples/ReservationDetailsWithReservationId.json */ /** * Sample code: ReservationDetailsWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", + public static void + reservationDetailsWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1318,124 +1401,87 @@ public final class ReservationsDetailsListByReservationOrderAndReservationSample ### ReservationsSummaries_List ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries List. */ +/** + * 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-11-01/examples/ReservationSummariesDailyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesDailyWithBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingAccountId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - Datagrain.DAILY, - null, - null, - "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345", Datagrain.DAILY, null, null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", null, null, + 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-11-01/examples/ReservationSummariesDailyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesDailyWithBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingProfileId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.DAILY, - "2017-10-01", - "2017-11-20", - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.DAILY, + "2017-10-01", "2017-11-20", null, null, null, 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-11-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingAccountId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - Datagrain.MONTHLY, - null, - null, - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345", Datagrain.MONTHLY, 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/ReservationSummariesMonthlyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.MONTHLY, - null, - null, - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, + 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/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileIdReservationId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.MONTHLY, - null, - null, - null, - "1c6b6358-709f-484c-85f1-72e862a0cf3b", - "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, + null, null, null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + com.azure.core.util.Context.NONE); } } ``` @@ -1443,41 +1489,39 @@ public final class ReservationsSummariesListSamples { ### ReservationsSummaries_ListByReservationOrder ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries ListByReservationOrder. */ +/** + * 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-11-01/examples/ReservationSummariesMonthly.json */ /** * Sample code: ReservationSummariesMonthly. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); + manager.reservationsSummaries() + .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-11-01/examples/ReservationSummariesDaily.json */ /** * Sample code: ReservationSummariesDaily. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDaily(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrder( - "00000000-0000-0000-0000-000000000000", - Datagrain.DAILY, + manager.reservationsSummaries() + .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -1485,49 +1529,42 @@ public final class ReservationsSummariesListByReservationOrderSamples { ### ReservationsSummaries_ListByReservationOrderAndReservation ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ +/** + * 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-11-01/examples/ReservationSummariesDailyWithReservationId.json */ /** * Sample code: ReservationSummariesDailyWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesDailyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - Datagrain.DAILY, + public static void + reservationSummariesDailyWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsSummaries() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + 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-11-01/examples/ReservationSummariesMonthlyWithReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesMonthlyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - Datagrain.MONTHLY, - null, - Context.NONE); + public static void + reservationSummariesMonthlyWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsSummaries() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, com.azure.core.util.Context.NONE); } } ``` @@ -1535,20 +1572,22 @@ public final class ReservationsSummariesListByReservationOrderAndReservationSamp ### Tags_Get ```java -import com.azure.core.util.Context; - -/** Samples for Tags Get. */ +/** + * 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-11-01/examples/Tags.json */ /** * Sample code: Tags_Get. - * + * * @param manager Entry point to ConsumptionManager. */ public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + manager.tags() + .getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", + com.azure.core.util.Context.NONE); } } ``` @@ -1556,348 +1595,294 @@ public final class TagsGetSamples { ### UsageDetails_List ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Metrictype; -/** Samples for UsageDetails List. */ +/** + * 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-11-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void billingAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCAInvoiceSection.json */ /** * Sample code: InvoiceSectionUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void invoiceSectionUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", - null, - null, - null, - null, - null, - Context.NONE); + public static void + invoiceSectionUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", null, null, null, + null, null, 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-11-01/examples/UsageDetailsList.json */ /** * Sample code: UsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListFilterByTag.json */ /** * Sample code: UsageDetailsListFilterByTag-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListFilterByTagLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - "tags eq 'dev:tools'", - null, - null, - null, - Context.NONE); + public static void + usageDetailsListFilterByTagLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, "tags eq 'dev:tools'", null, null, null, + 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-11-01/examples/UsageDetailsListByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + public static void + billingAccountUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCABillingProfile.json */ /** * Sample code: BillingProfileUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingProfileUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", - null, - null, - null, - null, - null, - Context.NONE); + public static void + billingProfileUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", null, null, null, null, + null, 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-11-01/examples/UsageDetailsListForBillingPeriodByDepartment.json */ /** * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void departmentUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void managementGroupUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMetricAmortizedCost.json */ /** * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricAmortizedCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.AMORTIZEDCOST, - Context.NONE); + public static void + usageDetailsListByMetricAmortizedCostLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, + Metrictype.AMORTIZEDCOST, 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-11-01/examples/UsageDetailsListByMetricUsage.json */ /** * Sample code: UsageDetailsListByMetricUsage-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricUsageLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.USAGE, - Context.NONE); + public static void + usageDetailsListByMetricUsageLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, Metrictype.USAGE, + 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-11-01/examples/UsageDetailsListByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void managementGroupUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + public static void + managementGroupUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByDepartment.json */ /** * Sample code: DepartmentUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void departmentUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + public static void + departmentUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMetricActualCost.json */ /** * Sample code: UsageDetailsListByMetricActualCost-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricActualCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.ACTUALCOST, - Context.NONE); + public static void + usageDetailsListByMetricActualCostLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, Metrictype.ACTUALCOST, + 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-11-01/examples/UsageDetailsListByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void enrollmentAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + public static void + enrollmentAccountUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCABillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); + public static void + billingAccountUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCACustomer.json */ /** * Sample code: CustomerUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void customerUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() + public static void + customerUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() .list( "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - null, - Context.NONE); + 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/UsageDetailsExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/UsageDetailsExpand.json */ /** * Sample code: UsageDetailsExpand-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsExpandLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - "meterDetails,additionalInfo", - "tags eq 'dev:tools'", - null, - 1, - null, - Context.NONE); + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", "meterDetails,additionalInfo", + "tags eq 'dev:tools'", null, 1, null, 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-11-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListForBillingPeriod.json */ /** * Sample code: UsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + public static void + usageDetailsListForBillingPeriodLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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 4a3878aaaebd..1bd5cb9226f8 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-11. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,9 @@ UTF-8 - true + 0 + 0 + true diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/ConsumptionManager.java index fba287434277..c55d901bf44d 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.HttpLogOptions; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpLogOptions; 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; @@ -35,9 +37,9 @@ import com.azure.resourcemanager.consumption.implementation.PriceSheetsImpl; import com.azure.resourcemanager.consumption.implementation.ReservationRecommendationDetailsImpl; import com.azure.resourcemanager.consumption.implementation.ReservationRecommendationsImpl; -import com.azure.resourcemanager.consumption.implementation.ReservationTransactionsImpl; import com.azure.resourcemanager.consumption.implementation.ReservationsDetailsImpl; import com.azure.resourcemanager.consumption.implementation.ReservationsSummariesImpl; +import com.azure.resourcemanager.consumption.implementation.ReservationTransactionsImpl; import com.azure.resourcemanager.consumption.implementation.TagsImpl; import com.azure.resourcemanager.consumption.implementation.UsageDetailsImpl; import com.azure.resourcemanager.consumption.models.AggregatedCosts; @@ -52,9 +54,9 @@ import com.azure.resourcemanager.consumption.models.PriceSheets; import com.azure.resourcemanager.consumption.models.ReservationRecommendationDetails; import com.azure.resourcemanager.consumption.models.ReservationRecommendations; -import com.azure.resourcemanager.consumption.models.ReservationTransactions; import com.azure.resourcemanager.consumption.models.ReservationsDetails; import com.azure.resourcemanager.consumption.models.ReservationsSummaries; +import com.azure.resourcemanager.consumption.models.ReservationTransactions; import com.azure.resourcemanager.consumption.models.Tags; import com.azure.resourcemanager.consumption.models.UsageDetails; import java.time.Duration; @@ -65,8 +67,8 @@ import java.util.stream.Collectors; /** - * Entry point to ConsumptionManager. Consumption management client provides access to consumption resources for Azure - * Enterprise Subscriptions. + * Entry point to ConsumptionManager. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ public final class ConsumptionManager { private UsageDetails usageDetails; @@ -108,18 +110,16 @@ public final class ConsumptionManager { private ConsumptionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new ConsumptionManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new ConsumptionManagementClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** * Creates an instance of Consumption service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the Consumption service API instance. @@ -130,24 +130,40 @@ 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. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new ConsumptionManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * 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; } @@ -234,15 +265,13 @@ public ConsumptionManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") + userAgentBuilder.append("azsdk-java") .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(" (") + userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) .append("; ") .append(Configuration.getGlobalConfiguration().get("os.name")) @@ -257,41 +286,40 @@ 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( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new ConsumptionManager(httpPipeline, profile, defaultPollInterval); } } - /** @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 +327,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 +339,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 +351,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 +363,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 +375,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 +387,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 +399,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,34 +411,50 @@ 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 = - new ReservationRecommendationsImpl(clientObject.getReservationRecommendations(), this); + this.reservationRecommendations + = new ReservationRecommendationsImpl(clientObject.getReservationRecommendations(), this); } 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 = - new ReservationRecommendationDetailsImpl(clientObject.getReservationRecommendationDetails(), this); + this.reservationRecommendationDetails + = new ReservationRecommendationDetailsImpl(clientObject.getReservationRecommendationDetails(), this); } 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 = - new ReservationTransactionsImpl(clientObject.getReservationTransactions(), this); + this.reservationTransactions + = new ReservationTransactionsImpl(clientObject.getReservationTransactions(), this); } 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 +462,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 +474,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 +486,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 +498,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 +510,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); @@ -431,8 +523,10 @@ public Credits credits() { } /** - * @return Wrapped service client ConsumptionManagementClient providing direct access to the underlying - * auto-generated API implementation, based on Azure REST API. + * Gets wrapped service client ConsumptionManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + * + * @return Wrapped service client ConsumptionManagementClient. */ public ConsumptionManagementClient serviceClient() { return this.clientObject; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/AggregatedCostsClient.java index 813767044909..6bf61ca51955 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 @@ -10,63 +10,65 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner; -/** An instance of this class provides access to all the operations defined in AggregatedCostsClient. */ +/** + * An instance of this class provides access to all the operations defined in AggregatedCostsClient. + */ 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 e21a93426a85..0e8cc73c081c 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 @@ -10,62 +10,64 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.BalanceInner; -/** An instance of this class provides access to all the operations defined in BalancesClient. */ +/** + * An instance of this class provides access to all the operations defined in BalancesClient. + */ public interface BalancesClient { /** * 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. + * @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 * for May 1, 2014 or later. - * + * * @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 * for May 1, 2014 or later. - * + * * @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 031ef9c557ca..2d81f64659bc 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 @@ -11,205 +11,199 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.BudgetInner; -/** An instance of this class provides access to all the operations defined in BudgetsClient. */ +/** + * An instance of this class provides access to all the operations defined in BudgetsClient. + */ public interface BudgetsClient { /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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); /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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); /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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 * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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 * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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 58df00d67d60..93f311441dd9 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 @@ -10,69 +10,69 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner; -/** An instance of this class provides access to all the operations defined in ChargesClient. */ +/** + * An instance of this class provides access to all the operations defined in ChargesClient. + */ public interface ChargesClient { /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * 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. + * @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. - * + * * @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}' - * 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. - * @param context The context to associate with this operation. + * '/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of listing 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/ConsumptionManagementClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java index d27deeac3726..9d4e04161fbf 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ConsumptionManagementClient.java @@ -7,158 +7,160 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for ConsumptionManagementClient class. */ +/** + * The interface for ConsumptionManagementClient class. + */ public interface ConsumptionManagementClient { /** * Gets Azure Subscription ID. - * + * * @return the subscriptionId value. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the UsageDetailsClient object to access its operations. - * + * * @return the UsageDetailsClient object. */ UsageDetailsClient getUsageDetails(); /** * Gets the MarketplacesClient object to access its operations. - * + * * @return the MarketplacesClient object. */ MarketplacesClient getMarketplaces(); /** * Gets the BudgetsClient object to access its operations. - * + * * @return the BudgetsClient object. */ BudgetsClient getBudgets(); /** * Gets the TagsClient object to access its operations. - * + * * @return the TagsClient object. */ TagsClient getTags(); /** * Gets the ChargesClient object to access its operations. - * + * * @return the ChargesClient object. */ ChargesClient getCharges(); /** * Gets the BalancesClient object to access its operations. - * + * * @return the BalancesClient object. */ BalancesClient getBalances(); /** * Gets the ReservationsSummariesClient object to access its operations. - * + * * @return the ReservationsSummariesClient object. */ ReservationsSummariesClient getReservationsSummaries(); /** * Gets the ReservationsDetailsClient object to access its operations. - * + * * @return the ReservationsDetailsClient object. */ ReservationsDetailsClient getReservationsDetails(); /** * Gets the ReservationRecommendationsClient object to access its operations. - * + * * @return the ReservationRecommendationsClient object. */ ReservationRecommendationsClient getReservationRecommendations(); /** * Gets the ReservationRecommendationDetailsClient object to access its operations. - * + * * @return the ReservationRecommendationDetailsClient object. */ ReservationRecommendationDetailsClient getReservationRecommendationDetails(); /** * Gets the ReservationTransactionsClient object to access its operations. - * + * * @return the ReservationTransactionsClient object. */ ReservationTransactionsClient getReservationTransactions(); /** * Gets the PriceSheetsClient object to access its operations. - * + * * @return the PriceSheetsClient object. */ PriceSheetsClient getPriceSheets(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the AggregatedCostsClient object to access its operations. - * + * * @return the AggregatedCostsClient object. */ AggregatedCostsClient getAggregatedCosts(); /** * Gets the EventsOperationsClient object to access its operations. - * + * * @return the EventsOperationsClient object. */ EventsOperationsClient getEventsOperations(); /** * Gets the LotsOperationsClient object to access its operations. - * + * * @return the LotsOperationsClient object. */ LotsOperationsClient getLotsOperations(); /** * Gets the CreditsClient object to access its operations. - * + * * @return the CreditsClient object. */ CreditsClient getCredits(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/CreditsClient.java index 4a9bba8b64c6..5d7990e373e3 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 @@ -10,32 +10,34 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner; -/** An instance of this class provides access to all the operations defined in CreditsClient. */ +/** + * An instance of this class provides access to all the operations defined in CreditsClient. + */ public interface CreditsClient { /** * 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. + * @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 7591c8b7840b..7a5b5cfb072d 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 @@ -10,12 +10,14 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; -/** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in EventsOperationsClient. + */ public interface EventsOperationsClient { /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -23,16 +25,16 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate); /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -41,21 +43,21 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate, Context context); /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingAccount(String billingAccountId); @@ -63,16 +65,16 @@ PagedIterable listByBillingProfile( /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/LotsOperationsClient.java index 6c7db7249652..606ef1d8020a 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 @@ -10,65 +10,99 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; -/** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ +/** + * 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. * @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. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, Context context); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + Context context); /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing lot summary. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer(String billingAccountId, String customerId); + + /** + * Lists all Azure credits for a customer. The API is only supported for Microsoft Partner Agreements (MPA) billing + * accounts. + * + * @param billingAccountId BillingAccount ID. + * @param customerId Customer ID. + * @param filter May be used to filter the lots by Status, Source etc. The filter supports 'eq', 'lt', 'gt', 'le', + * 'ge', and 'and'. Tag filter is a key value pair string where key and value is separated by a colon (:). + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByCustomer(String billingAccountId, String customerId, String filter, + Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/MarketplacesClient.java index 56f5b91e7340..1e84c1962e60 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 @@ -10,25 +10,27 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner; -/** An instance of this class provides access to all the operations defined in MarketplacesClient. */ +/** + * An instance of this class provides access to all the operations defined in MarketplacesClient. + */ public interface MarketplacesClient { /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); @@ -36,28 +38,28 @@ public interface MarketplacesClient { /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, String filter, Integer top, String skiptoken, Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/OperationsClient.java index d8528c9abbd3..f3c685991cc8 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 @@ -10,26 +10,28 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * Lists all of the available consumption REST API 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}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * Lists all of the available consumption REST API operations. - * + * * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/PriceSheetsClient.java index 083b16f7e65c..154dc414cc31 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,14 +7,37 @@ 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. */ +/** + * 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. + * * @throws com.azure.core.management.exception.ManagementException 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. @@ -23,27 +46,30 @@ 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. + * 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. + * 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. + * @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 * for May 1, 2014 or later. - * + * * @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. @@ -54,23 +80,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) + 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) - Response getByBillingPeriodWithResponse( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context); + 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 042ad2b40fdd..6143fa65e28b 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; /** @@ -18,48 +19,52 @@ 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 - * '/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 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @param filter Used to filter reservation recommendation details by: properties/subscriptionId can be specified + * for billing account and billing profile paths. + * @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, String filter, 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 - * '/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 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. + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 c713f5d4d277..91e1aa4368a7 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 @@ -10,46 +10,48 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; -/** An instance of this class provides access to all the operations defined in ReservationRecommendationsClient. */ +/** + * An instance of this class provides access to all the operations defined in ReservationRecommendationsClient. + */ public interface ReservationRecommendationsClient { /** * List of recommendations for purchasing reserved instances. - * - * @param scope 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 - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile 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 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @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 scope, String filter, Context context); + PagedIterable list(String resourceScope, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationTransactionsClient.java index 3d45b967b6e3..4060747088e8 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,64 +10,90 @@ 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. */ +/** + * 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); + 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( - String billingAccountId, String billingProfileId, String filter, Context context); + 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/fluent/ReservationsDetailsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsDetailsClient.java index 2ffbf884bf39..fc258c8e085a 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 @@ -10,114 +10,134 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner; -/** An instance of this class provides access to all the operations defined in ReservationsDetailsClient. */ +/** + * 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 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); + 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); + 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 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); + PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter, Context context); /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope 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). + * 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 resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context); + PagedIterable list(String resourceScope, String startDate, String endDate, String filter, + String reservationId, String reservationOrderId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/ReservationsSummariesClient.java index 40be069d1339..5e0c268e4d4e 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 @@ -11,117 +11,124 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner; import com.azure.resourcemanager.consumption.models.Datagrain; -/** An instance of this class provides access to all the operations defined in ReservationsSummariesClient. */ +/** + * 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 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); + 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. * @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 listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain); + 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 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); + PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain, String filter, Context context); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope 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). + * 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 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). * @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 list(String scope, Datagrain grain); + PagedIterable list(String resourceScope, Datagrain grain); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context); + PagedIterable list(String resourceScope, Datagrain grain, String startDate, String endDate, + String filter, String reservationId, String reservationOrderId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/TagsClient.java index 2266b2caca8c..381907adfc02 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 @@ -10,44 +10,44 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.fluent.models.TagsResultInner; -/** An instance of this class provides access to all the operations defined in TagsClient. */ +/** + * An instance of this class provides access to all the operations defined in TagsClient. + */ public interface TagsClient { /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * 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 com.azure.core.management.exception.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. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * 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. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group 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 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 e89c21afee28..949d35836c6a 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 @@ -11,33 +11,40 @@ import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import com.azure.resourcemanager.consumption.models.Metrictype; -/** An instance of this class provides access to all the operations defined in UsageDetailsClient. */ +/** + * An instance of this class provides access to all the operations defined in UsageDetailsClient. + */ 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -45,43 +52,48 @@ 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @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 usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context); + 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/fluent/models/BalanceInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceInner.java index be4d23435c3b..7cb790bb5562 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,22 +6,20 @@ 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; import java.util.List; import java.util.Map; -/** A balance resource. */ +/** + * 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,9 +39,15 @@ 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. - * + * * @return the innerProperties value. */ private BalanceProperties innerProperties() { @@ -52,7 +56,7 @@ private BalanceProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -61,7 +65,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -70,7 +74,7 @@ public Map tags() { /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -79,7 +83,7 @@ public String currency() { /** * Get the beginningBalance property: The beginning balance for the billing period. - * + * * @return the beginningBalance value. */ public BigDecimal beginningBalance() { @@ -89,7 +93,7 @@ public BigDecimal beginningBalance() { /** * Get the endingBalance property: The ending balance for the billing period (for open periods this will be updated * daily). - * + * * @return the endingBalance value. */ public BigDecimal endingBalance() { @@ -98,7 +102,7 @@ public BigDecimal endingBalance() { /** * Get the newPurchases property: Total new purchase amount. - * + * * @return the newPurchases value. */ public BigDecimal newPurchases() { @@ -107,7 +111,7 @@ public BigDecimal newPurchases() { /** * Get the adjustments property: Total adjustment amount. - * + * * @return the adjustments value. */ public BigDecimal adjustments() { @@ -116,7 +120,7 @@ public BigDecimal adjustments() { /** * Get the utilized property: Total Commitment usage. - * + * * @return the utilized value. */ public BigDecimal utilized() { @@ -125,7 +129,7 @@ public BigDecimal utilized() { /** * Get the serviceOverage property: Overage for Azure services. - * + * * @return the serviceOverage value. */ public BigDecimal serviceOverage() { @@ -134,7 +138,7 @@ public BigDecimal serviceOverage() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -143,7 +147,7 @@ public BigDecimal chargesBilledSeparately() { /** * Get the totalOverage property: serviceOverage + chargesBilledSeparately. - * + * * @return the totalOverage value. */ public BigDecimal totalOverage() { @@ -152,7 +156,7 @@ public BigDecimal totalOverage() { /** * Get the totalUsage property: Azure service commitment + total Overage. - * + * * @return the totalUsage value. */ public BigDecimal totalUsage() { @@ -161,7 +165,7 @@ public BigDecimal totalUsage() { /** * Get the azureMarketplaceServiceCharges property: Total charges for Azure Marketplace. - * + * * @return the azureMarketplaceServiceCharges value. */ public BigDecimal azureMarketplaceServiceCharges() { @@ -170,7 +174,7 @@ public BigDecimal azureMarketplaceServiceCharges() { /** * Get the billingFrequency property: The billing frequency. - * + * * @return the billingFrequency value. */ public BillingFrequency billingFrequency() { @@ -179,7 +183,7 @@ public BillingFrequency billingFrequency() { /** * Set the billingFrequency property: The billing frequency. - * + * * @param billingFrequency the billingFrequency value to set. * @return the BalanceInner object itself. */ @@ -193,16 +197,25 @@ public BalanceInner withBillingFrequency(BillingFrequency billingFrequency) { /** * Get the priceHidden property: Price is hidden or not. - * + * * @return the priceHidden value. */ 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. - * + * * @return the newPurchasesDetails value. */ public List newPurchasesDetails() { @@ -211,7 +224,7 @@ public List newPurchasesDetails() { /** * Get the adjustmentDetails property: List of Adjustments (Promo credit, SIE credit etc.). - * + * * @return the adjustmentDetails value. */ public List adjustmentDetails() { @@ -220,7 +233,7 @@ public List adjustmentDetails() { /** * 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/BalanceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BalanceProperties.java index f0e15ad53cf2..a30b2dd2557a 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,20 +5,18 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem; import com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem; import com.azure.resourcemanager.consumption.models.BillingFrequency; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.List; -/** The properties of the balance. */ +/** + * 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 +30,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 +95,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,9 +113,15 @@ 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. - * + * * @return the currency value. */ public String currency() { @@ -121,7 +130,7 @@ public String currency() { /** * Get the beginningBalance property: The beginning balance for the billing period. - * + * * @return the beginningBalance value. */ public BigDecimal beginningBalance() { @@ -131,7 +140,7 @@ public BigDecimal beginningBalance() { /** * Get the endingBalance property: The ending balance for the billing period (for open periods this will be updated * daily). - * + * * @return the endingBalance value. */ public BigDecimal endingBalance() { @@ -140,7 +149,7 @@ public BigDecimal endingBalance() { /** * Get the newPurchases property: Total new purchase amount. - * + * * @return the newPurchases value. */ public BigDecimal newPurchases() { @@ -149,7 +158,7 @@ public BigDecimal newPurchases() { /** * Get the adjustments property: Total adjustment amount. - * + * * @return the adjustments value. */ public BigDecimal adjustments() { @@ -158,7 +167,7 @@ public BigDecimal adjustments() { /** * Get the utilized property: Total Commitment usage. - * + * * @return the utilized value. */ public BigDecimal utilized() { @@ -167,7 +176,7 @@ public BigDecimal utilized() { /** * Get the serviceOverage property: Overage for Azure services. - * + * * @return the serviceOverage value. */ public BigDecimal serviceOverage() { @@ -176,7 +185,7 @@ public BigDecimal serviceOverage() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -185,7 +194,7 @@ public BigDecimal chargesBilledSeparately() { /** * Get the totalOverage property: serviceOverage + chargesBilledSeparately. - * + * * @return the totalOverage value. */ public BigDecimal totalOverage() { @@ -194,7 +203,7 @@ public BigDecimal totalOverage() { /** * Get the totalUsage property: Azure service commitment + total Overage. - * + * * @return the totalUsage value. */ public BigDecimal totalUsage() { @@ -203,7 +212,7 @@ public BigDecimal totalUsage() { /** * Get the azureMarketplaceServiceCharges property: Total charges for Azure Marketplace. - * + * * @return the azureMarketplaceServiceCharges value. */ public BigDecimal azureMarketplaceServiceCharges() { @@ -212,7 +221,7 @@ public BigDecimal azureMarketplaceServiceCharges() { /** * Get the billingFrequency property: The billing frequency. - * + * * @return the billingFrequency value. */ public BillingFrequency billingFrequency() { @@ -221,7 +230,7 @@ public BillingFrequency billingFrequency() { /** * Set the billingFrequency property: The billing frequency. - * + * * @param billingFrequency the billingFrequency value to set. * @return the BalanceProperties object itself. */ @@ -232,16 +241,25 @@ public BalanceProperties withBillingFrequency(BillingFrequency billingFrequency) /** * Get the priceHidden property: Price is hidden or not. - * + * * @return the priceHidden value. */ 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. - * + * * @return the newPurchasesDetails value. */ public List newPurchasesDetails() { @@ -250,7 +268,7 @@ public List newPurchasesDetails() { /** * Get the adjustmentDetails property: List of Adjustments (Promo credit, SIE credit etc.). - * + * * @return the adjustmentDetails value. */ public List adjustmentDetails() { @@ -259,7 +277,7 @@ public List adjustmentDetails() { /** * 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/BudgetInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetInner.java index f8fea1a4e18b..2e1940048208 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,16 +13,15 @@ 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; -/** A budget resource. */ +/** + * 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,16 +29,20 @@ 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. - * + * * @return the innerProperties value. */ private BudgetProperties innerProperties() { @@ -50,7 +52,7 @@ private BudgetProperties innerProperties() { /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ public String etag() { @@ -60,7 +62,7 @@ public String etag() { /** * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @param etag the etag value to set. * @return the BudgetInner object itself. */ @@ -71,7 +73,7 @@ public BudgetInner withEtag(String etag) { /** * Get the category property: The category of the budget, whether the budget tracks cost or usage. - * + * * @return the category value. */ public CategoryType category() { @@ -80,7 +82,7 @@ public CategoryType category() { /** * Set the category property: The category of the budget, whether the budget tracks cost or usage. - * + * * @param category the category value to set. * @return the BudgetInner object itself. */ @@ -94,7 +96,7 @@ public BudgetInner withCategory(CategoryType category) { /** * Get the amount property: The total amount of cost to track with the budget. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -103,7 +105,7 @@ public BigDecimal amount() { /** * Set the amount property: The total amount of cost to track with the budget. - * + * * @param amount the amount value to set. * @return the BudgetInner object itself. */ @@ -118,7 +120,7 @@ public BudgetInner withAmount(BigDecimal amount) { /** * Get the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. - * + * * @return the timeGrain value. */ public TimeGrainType timeGrain() { @@ -128,7 +130,7 @@ public TimeGrainType timeGrain() { /** * Set the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. - * + * * @param timeGrain the timeGrain value to set. * @return the BudgetInner object itself. */ @@ -145,7 +147,7 @@ public BudgetInner withTimeGrain(TimeGrainType timeGrain) { * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should * not be more than twelve months. Past start date should be selected within the timegrain period. There are no * restrictions on the end date. - * + * * @return the timePeriod value. */ public BudgetTimePeriod timePeriod() { @@ -157,7 +159,7 @@ public BudgetTimePeriod timePeriod() { * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should * not be more than twelve months. Past start date should be selected within the timegrain period. There are no * restrictions on the end date. - * + * * @param timePeriod the timePeriod value to set. * @return the BudgetInner object itself. */ @@ -171,7 +173,7 @@ public BudgetInner withTimePeriod(BudgetTimePeriod timePeriod) { /** * Get the filter property: May be used to filter budgets by user-specified dimensions and/or tags. - * + * * @return the filter value. */ public BudgetFilter filter() { @@ -180,7 +182,7 @@ public BudgetFilter filter() { /** * Set the filter property: May be used to filter budgets by user-specified dimensions and/or tags. - * + * * @param filter the filter value to set. * @return the BudgetInner object itself. */ @@ -194,7 +196,7 @@ public BudgetInner withFilter(BudgetFilter filter) { /** * Get the currentSpend property: The current amount of cost which is being tracked for a budget. - * + * * @return the currentSpend value. */ public CurrentSpend currentSpend() { @@ -204,7 +206,7 @@ public CurrentSpend currentSpend() { /** * Get the notifications property: Dictionary of notifications associated with the budget. Budget can have up to * five notifications. - * + * * @return the notifications value. */ public Map notifications() { @@ -214,7 +216,7 @@ public Map notifications() { /** * Set the notifications property: Dictionary of notifications associated with the budget. Budget can have up to * five notifications. - * + * * @param notifications the notifications value to set. * @return the BudgetInner object itself. */ @@ -228,7 +230,7 @@ public BudgetInner withNotifications(Map notifications) { /** * Get the forecastSpend property: The forecasted cost which is being tracked for a budget. - * + * * @return the forecastSpend value. */ public ForecastSpend forecastSpend() { @@ -237,7 +239,7 @@ public ForecastSpend forecastSpend() { /** * 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/BudgetProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/BudgetProperties.java index ef8131acd287..c9c90d3228f1 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,17 +13,16 @@ import com.azure.resourcemanager.consumption.models.ForecastSpend; import com.azure.resourcemanager.consumption.models.Notification; import com.azure.resourcemanager.consumption.models.TimeGrainType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.util.Map; -/** The properties of the budget. */ +/** + * 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 +36,13 @@ 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 +60,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,9 +72,15 @@ 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. - * + * * @return the category value. */ public CategoryType category() { @@ -91,7 +89,7 @@ public CategoryType category() { /** * Set the category property: The category of the budget, whether the budget tracks cost or usage. - * + * * @param category the category value to set. * @return the BudgetProperties object itself. */ @@ -102,7 +100,7 @@ public BudgetProperties withCategory(CategoryType category) { /** * Get the amount property: The total amount of cost to track with the budget. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -111,7 +109,7 @@ public BigDecimal amount() { /** * Set the amount property: The total amount of cost to track with the budget. - * + * * @param amount the amount value to set. * @return the BudgetProperties object itself. */ @@ -123,7 +121,7 @@ public BudgetProperties withAmount(BigDecimal amount) { /** * Get the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. - * + * * @return the timeGrain value. */ public TimeGrainType timeGrain() { @@ -133,7 +131,7 @@ public TimeGrainType timeGrain() { /** * Set the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. - * + * * @param timeGrain the timeGrain value to set. * @return the BudgetProperties object itself. */ @@ -147,7 +145,7 @@ public BudgetProperties withTimeGrain(TimeGrainType timeGrain) { * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should * not be more than twelve months. Past start date should be selected within the timegrain period. There are no * restrictions on the end date. - * + * * @return the timePeriod value. */ public BudgetTimePeriod timePeriod() { @@ -159,7 +157,7 @@ public BudgetTimePeriod timePeriod() { * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should * not be more than twelve months. Past start date should be selected within the timegrain period. There are no * restrictions on the end date. - * + * * @param timePeriod the timePeriod value to set. * @return the BudgetProperties object itself. */ @@ -170,7 +168,7 @@ public BudgetProperties withTimePeriod(BudgetTimePeriod timePeriod) { /** * Get the filter property: May be used to filter budgets by user-specified dimensions and/or tags. - * + * * @return the filter value. */ public BudgetFilter filter() { @@ -179,7 +177,7 @@ public BudgetFilter filter() { /** * Set the filter property: May be used to filter budgets by user-specified dimensions and/or tags. - * + * * @param filter the filter value to set. * @return the BudgetProperties object itself. */ @@ -190,7 +188,7 @@ public BudgetProperties withFilter(BudgetFilter filter) { /** * Get the currentSpend property: The current amount of cost which is being tracked for a budget. - * + * * @return the currentSpend value. */ public CurrentSpend currentSpend() { @@ -200,7 +198,7 @@ public CurrentSpend currentSpend() { /** * Get the notifications property: Dictionary of notifications associated with the budget. Budget can have up to * five notifications. - * + * * @return the notifications value. */ public Map notifications() { @@ -210,7 +208,7 @@ public Map notifications() { /** * Set the notifications property: Dictionary of notifications associated with the budget. Budget can have up to * five notifications. - * + * * @param notifications the notifications value to set. * @return the BudgetProperties object itself. */ @@ -221,7 +219,7 @@ public BudgetProperties withNotifications(Map notification /** * Get the forecastSpend property: The forecasted cost which is being tracked for a budget. - * + * * @return the forecastSpend value. */ public ForecastSpend forecastSpend() { @@ -230,29 +228,25 @@ public ForecastSpend forecastSpend() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (category() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property category in model BudgetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property category in model BudgetProperties")); } if (amount() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property amount in model BudgetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property amount in model BudgetProperties")); } if (timeGrain() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timeGrain in model BudgetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property timeGrain in model BudgetProperties")); } if (timePeriod() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property timePeriod in model BudgetProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property timePeriod in model BudgetProperties")); } else { timePeriod().validate(); } @@ -263,17 +257,16 @@ public void validate() { currentSpend().validate(); } if (notifications() != null) { - notifications() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); + notifications().values().forEach(e -> { + if (e != null) { + e.validate(); + } + }); } if (forecastSpend() != null) { forecastSpend().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetProperties.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ChargesListResultInner.java index 4675dd79f2cb..2760abd2e028 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,26 +5,30 @@ 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. */ +/** + * 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. - * + * * @return the value value. */ public List value() { @@ -33,7 +37,7 @@ public List value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryInner.java index 0ee648db2f11..6ef2c37c8705 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,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.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. */ +/** + * 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,21 +23,20 @@ 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. + /** + * Creates an instance of CreditSummaryInner class. */ - @JsonProperty(value = "tags", access = JsonProperty.Access.WRITE_ONLY) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map tags; + public CreditSummaryInner() { + } /** * Get the innerProperties property: The properties of the credit summary. - * + * * @return the innerProperties value. */ private CreditSummaryProperties innerProperties() { @@ -49,8 +44,9 @@ 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. */ public String etag() { @@ -58,17 +54,20 @@ public String etag() { } /** - * Get the tags property: Resource tags. - * - * @return the tags value. + * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to + * determine whether the user is updating the latest version or not. + * + * @param etag the etag value to set. + * @return the CreditSummaryInner object itself. */ - public Map tags() { - return this.tags; + public CreditSummaryInner withEtag(String etag) { + this.etag = etag; + return this; } /** * Get the balanceSummary property: Summary of balances associated with this credit summary. - * + * * @return the balanceSummary value. */ public CreditBalanceSummary balanceSummary() { @@ -77,7 +76,7 @@ public CreditBalanceSummary balanceSummary() { /** * Get the pendingCreditAdjustments property: Pending credit adjustments. - * + * * @return the pendingCreditAdjustments value. */ public Amount pendingCreditAdjustments() { @@ -86,7 +85,7 @@ public Amount pendingCreditAdjustments() { /** * Get the expiredCredit property: Expired credit. - * + * * @return the expiredCredit value. */ public Amount expiredCredit() { @@ -95,7 +94,7 @@ public Amount expiredCredit() { /** * Get the pendingEligibleCharges property: Pending eligible charges. - * + * * @return the pendingEligibleCharges value. */ public Amount pendingEligibleCharges() { @@ -104,7 +103,7 @@ public Amount pendingEligibleCharges() { /** * Get the creditCurrency property: The credit currency. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -113,7 +112,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -122,16 +121,26 @@ public String billingCurrency() { /** * Get the reseller property: Credit's reseller. - * + * * @return the reseller value. */ 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. - * + * * @return the etag value. */ public String etagPropertiesEtag() { @@ -140,7 +149,7 @@ public String etagPropertiesEtag() { /** * 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/CreditSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/CreditSummaryProperties.java index cbe557ebe2bb..8348d610171f 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,16 @@ 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. */ +/** + * 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,15 +57,27 @@ 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. - * + * * @return the balanceSummary value. */ public CreditBalanceSummary balanceSummary() { @@ -76,7 +86,7 @@ public CreditBalanceSummary balanceSummary() { /** * Get the pendingCreditAdjustments property: Pending credit adjustments. - * + * * @return the pendingCreditAdjustments value. */ public Amount pendingCreditAdjustments() { @@ -85,7 +95,7 @@ public Amount pendingCreditAdjustments() { /** * Get the expiredCredit property: Expired credit. - * + * * @return the expiredCredit value. */ public Amount expiredCredit() { @@ -94,7 +104,7 @@ public Amount expiredCredit() { /** * Get the pendingEligibleCharges property: Pending eligible charges. - * + * * @return the pendingEligibleCharges value. */ public Amount pendingEligibleCharges() { @@ -103,7 +113,7 @@ public Amount pendingEligibleCharges() { /** * Get the creditCurrency property: The credit currency. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -112,7 +122,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -121,16 +131,26 @@ public String billingCurrency() { /** * Get the reseller property: Credit's reseller. - * + * * @return the reseller value. */ 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. - * + * * @return the etag value. */ public String etag() { @@ -139,7 +159,7 @@ public String etag() { /** * 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 c431a1c9e2bf..66de76800180 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,18 @@ 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. */ +/** + * The event properties. + */ @Fluent public final class EventProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventProperties.class); - /* * The date of the event. */ @@ -32,39 +30,47 @@ 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; /* - * The balance after the event. + * The balance after the event, Note: This will not be returned for Contributor Organization Type in Multi-Entity consumption commitment */ @JsonProperty(value = "closedBalance", access = JsonProperty.Access.WRITE_ONLY) private Amount closedBalance; + /* + * Identifier of the billing account. + */ + @JsonProperty(value = "billingAccountId", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountId; + + /* + * Name of the billing account. + */ + @JsonProperty(value = "billingAccountDisplayName", access = JsonProperty.Access.WRITE_ONLY) + private String billingAccountDisplayName; + /* * Identifies the type of the event. */ @@ -72,24 +78,19 @@ 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; @@ -101,7 +102,7 @@ public final class EventProperties { private String lotId; /* - * Identifies the source of the lot for which the event happened. + * Identifies the source of the lot for which the event happened. */ @JsonProperty(value = "lotSource", access = JsonProperty.Access.WRITE_ONLY) private String lotSource; @@ -131,15 +132,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,27 +150,38 @@ 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; /* - * The balance in billing currency after the event. + * The balance in billing currency after the event, Note: This will not be returned for Contributor Organization Type in Multi-Entity consumption commitment */ @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. - * + * * @return the transactionDate value. */ public OffsetDateTime transactionDate() { @@ -180,7 +190,7 @@ public OffsetDateTime transactionDate() { /** * Get the description property: The description of the event. - * + * * @return the description value. */ public String description() { @@ -189,7 +199,7 @@ public String description() { /** * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. - * + * * @return the newCredit value. */ public Amount newCredit() { @@ -199,7 +209,7 @@ public Amount newCredit() { /** * Get the adjustments property: The amount of balance adjustment. The property is not available for * ConsumptionCommitment lots. - * + * * @return the adjustments value. */ public Amount adjustments() { @@ -208,7 +218,7 @@ public Amount adjustments() { /** * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. - * + * * @return the creditExpired value. */ public Amount creditExpired() { @@ -217,7 +227,7 @@ public Amount creditExpired() { /** * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. - * + * * @return the charges value. */ public Amount charges() { @@ -225,17 +235,36 @@ public Amount charges() { } /** - * Get the closedBalance property: The balance after the event. - * + * Get the closedBalance property: The balance after the event, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalance value. */ public Amount closedBalance() { return this.closedBalance; } + /** + * Get the billingAccountId property: Identifier of the billing account. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.billingAccountId; + } + + /** + * Get the billingAccountDisplayName property: Name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + public String billingAccountDisplayName() { + return this.billingAccountDisplayName; + } + /** * Get the eventType property: Identifies the type of the event. - * + * * @return the eventType value. */ public EventType eventType() { @@ -244,7 +273,7 @@ public EventType eventType() { /** * Set the eventType property: Identifies the type of the event. - * + * * @param eventType the eventType value to set. * @return the EventProperties object itself. */ @@ -256,7 +285,7 @@ public EventProperties withEventType(EventType eventType) { /** * Get the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. * This will be empty for unbilled events. - * + * * @return the invoiceNumber value. */ public String invoiceNumber() { @@ -266,7 +295,7 @@ public String invoiceNumber() { /** * Get the billingProfileId property: The ID that uniquely identifies the billing profile for which the event * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -276,7 +305,7 @@ public String billingProfileId() { /** * Get the billingProfileDisplayName property: The display name of the billing profile for which the event happened. * The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileDisplayName value. */ public String billingProfileDisplayName() { @@ -285,7 +314,7 @@ public String billingProfileDisplayName() { /** * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. - * + * * @return the lotId value. */ public String lotId() { @@ -294,7 +323,7 @@ public String lotId() { /** * Get the lotSource property: Identifies the source of the lot for which the event happened. - * + * * @return the lotSource value. */ public String lotSource() { @@ -303,7 +332,7 @@ public String lotSource() { /** * Get the canceledCredit property: Amount of canceled credit. - * + * * @return the canceledCredit value. */ public Amount canceledCredit() { @@ -312,7 +341,7 @@ public Amount canceledCredit() { /** * Get the creditCurrency property: The credit currency of the event. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -321,7 +350,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency of the event. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -330,7 +359,7 @@ public String billingCurrency() { /** * Get the reseller property: The reseller of the event. - * + * * @return the reseller value. */ public Reseller reseller() { @@ -340,7 +369,7 @@ public Reseller reseller() { /** * Get the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the creditExpiredInBillingCurrency value. */ public AmountWithExchangeRate creditExpiredInBillingCurrency() { @@ -350,7 +379,7 @@ public AmountWithExchangeRate creditExpiredInBillingCurrency() { /** * Get the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the newCreditInBillingCurrency value. */ public AmountWithExchangeRate newCreditInBillingCurrency() { @@ -359,7 +388,7 @@ public AmountWithExchangeRate newCreditInBillingCurrency() { /** * Get the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. - * + * * @return the adjustmentsInBillingCurrency value. */ public AmountWithExchangeRate adjustmentsInBillingCurrency() { @@ -369,7 +398,7 @@ public AmountWithExchangeRate adjustmentsInBillingCurrency() { /** * Get the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and * PendingEligibleCharges in billing currency. - * + * * @return the chargesInBillingCurrency value. */ public AmountWithExchangeRate chargesInBillingCurrency() { @@ -377,17 +406,28 @@ public AmountWithExchangeRate chargesInBillingCurrency() { } /** - * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event. - * + * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event, Note: This will + * not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalanceInBillingCurrency value. */ 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. - * + * * @return the etag value. */ public String etag() { @@ -396,7 +436,7 @@ public String etag() { /** * 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/EventSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/EventSummaryInner.java index e031fc2d183d..c3001e8e6155 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,18 @@ 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. */ +/** + * An event summary resource. + */ @Fluent public final class EventSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(EventSummaryInner.class); - /* * The event properties. */ @@ -27,16 +25,20 @@ 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. - * + * * @return the innerProperties value. */ private EventProperties innerProperties() { @@ -46,7 +48,7 @@ private EventProperties innerProperties() { /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ public String etag() { @@ -56,7 +58,7 @@ public String etag() { /** * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @param etag the etag value to set. * @return the EventSummaryInner object itself. */ @@ -67,7 +69,7 @@ public EventSummaryInner withEtag(String etag) { /** * Get the transactionDate property: The date of the event. - * + * * @return the transactionDate value. */ public OffsetDateTime transactionDate() { @@ -76,7 +78,7 @@ public OffsetDateTime transactionDate() { /** * Get the description property: The description of the event. - * + * * @return the description value. */ public String description() { @@ -85,7 +87,7 @@ public String description() { /** * Get the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. - * + * * @return the newCredit value. */ public Amount newCredit() { @@ -95,7 +97,7 @@ public Amount newCredit() { /** * Get the adjustments property: The amount of balance adjustment. The property is not available for * ConsumptionCommitment lots. - * + * * @return the adjustments value. */ public Amount adjustments() { @@ -104,7 +106,7 @@ public Amount adjustments() { /** * Get the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. - * + * * @return the creditExpired value. */ public Amount creditExpired() { @@ -113,7 +115,7 @@ public Amount creditExpired() { /** * Get the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. - * + * * @return the charges value. */ public Amount charges() { @@ -121,17 +123,36 @@ public Amount charges() { } /** - * Get the closedBalance property: The balance after the event. - * + * Get the closedBalance property: The balance after the event, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalance value. */ public Amount closedBalance() { return this.innerProperties() == null ? null : this.innerProperties().closedBalance(); } + /** + * Get the billingAccountId property: Identifier of the billing account. + * + * @return the billingAccountId value. + */ + public String billingAccountId() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountId(); + } + + /** + * Get the billingAccountDisplayName property: Name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + public String billingAccountDisplayName() { + return this.innerProperties() == null ? null : this.innerProperties().billingAccountDisplayName(); + } + /** * Get the eventType property: Identifies the type of the event. - * + * * @return the eventType value. */ public EventType eventType() { @@ -140,7 +161,7 @@ public EventType eventType() { /** * Set the eventType property: Identifies the type of the event. - * + * * @param eventType the eventType value to set. * @return the EventSummaryInner object itself. */ @@ -155,7 +176,7 @@ public EventSummaryInner withEventType(EventType eventType) { /** * Get the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. * This will be empty for unbilled events. - * + * * @return the invoiceNumber value. */ public String invoiceNumber() { @@ -165,7 +186,7 @@ public String invoiceNumber() { /** * Get the billingProfileId property: The ID that uniquely identifies the billing profile for which the event * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -175,7 +196,7 @@ public String billingProfileId() { /** * Get the billingProfileDisplayName property: The display name of the billing profile for which the event happened. * The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileDisplayName value. */ public String billingProfileDisplayName() { @@ -184,7 +205,7 @@ public String billingProfileDisplayName() { /** * Get the lotId property: The ID that uniquely identifies the lot for which the event happened. - * + * * @return the lotId value. */ public String lotId() { @@ -193,7 +214,7 @@ public String lotId() { /** * Get the lotSource property: Identifies the source of the lot for which the event happened. - * + * * @return the lotSource value. */ public String lotSource() { @@ -202,7 +223,7 @@ public String lotSource() { /** * Get the canceledCredit property: Amount of canceled credit. - * + * * @return the canceledCredit value. */ public Amount canceledCredit() { @@ -211,7 +232,7 @@ public Amount canceledCredit() { /** * Get the creditCurrency property: The credit currency of the event. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -220,7 +241,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency of the event. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -229,7 +250,7 @@ public String billingCurrency() { /** * Get the reseller property: The reseller of the event. - * + * * @return the reseller value. */ public Reseller reseller() { @@ -239,7 +260,7 @@ public Reseller reseller() { /** * Get the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the creditExpiredInBillingCurrency value. */ public AmountWithExchangeRate creditExpiredInBillingCurrency() { @@ -249,7 +270,7 @@ public AmountWithExchangeRate creditExpiredInBillingCurrency() { /** * Get the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the newCreditInBillingCurrency value. */ public AmountWithExchangeRate newCreditInBillingCurrency() { @@ -258,7 +279,7 @@ public AmountWithExchangeRate newCreditInBillingCurrency() { /** * Get the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. - * + * * @return the adjustmentsInBillingCurrency value. */ public AmountWithExchangeRate adjustmentsInBillingCurrency() { @@ -268,7 +289,7 @@ public AmountWithExchangeRate adjustmentsInBillingCurrency() { /** * Get the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and * PendingEligibleCharges in billing currency. - * + * * @return the chargesInBillingCurrency value. */ public AmountWithExchangeRate chargesInBillingCurrency() { @@ -276,17 +297,28 @@ public AmountWithExchangeRate chargesInBillingCurrency() { } /** - * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event. - * + * Get the closedBalanceInBillingCurrency property: The balance in billing currency after the event, Note: This will + * not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalanceInBillingCurrency value. */ 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. - * + * * @return the etag value. */ public String etagPropertiesEtag() { @@ -295,7 +327,7 @@ public String etagPropertiesEtag() { /** * 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/LegacyChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyChargeSummaryProperties.java index 935660710f20..993b69f89f54 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,14 @@ 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. */ +/** + * 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 +46,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,9 +55,15 @@ 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. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -68,7 +72,7 @@ public String billingPeriodId() { /** * Get the usageStart property: Usage start date. - * + * * @return the usageStart value. */ public String usageStart() { @@ -77,7 +81,7 @@ public String usageStart() { /** * Get the usageEnd property: Usage end date. - * + * * @return the usageEnd value. */ public String usageEnd() { @@ -86,7 +90,7 @@ public String usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public BigDecimal azureCharges() { @@ -95,7 +99,7 @@ public BigDecimal azureCharges() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -103,17 +107,17 @@ public BigDecimal chargesBilledSeparately() { } /** - * Get the marketplaceCharges property: Marketplace Charges. - * - * @return the marketplaceCharges value. + * Get the azureMarketplaceCharges property: Marketplace Charges. + * + * @return the azureMarketplaceCharges value. */ - public BigDecimal marketplaceCharges() { - return this.marketplaceCharges; + public BigDecimal azureMarketplaceCharges() { + return this.azureMarketplaceCharges; } /** * Get the currency property: Currency Code. - * + * * @return the currency value. */ public String currency() { @@ -122,7 +126,7 @@ public String currency() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyReservationTransactionProperties.java index 55ddcf621918..160f28e1f6fd 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,18 +5,16 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** The properties of a legacy reservation transaction. */ +/** + * 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 +22,7 @@ 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,9 +153,15 @@ 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. - * + * * @return the eventDate value. */ public OffsetDateTime eventDate() { @@ -173,7 +172,7 @@ public OffsetDateTime eventDate() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -182,7 +181,7 @@ public String reservationOrderId() { /** * Get the description property: The description of the transaction. - * + * * @return the description value. */ public String description() { @@ -190,8 +189,8 @@ 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. */ public String eventType() { @@ -200,7 +199,7 @@ public String eventType() { /** * Get the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -209,7 +208,7 @@ public BigDecimal quantity() { /** * Get the amount property: The charge of the transaction. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -218,7 +217,7 @@ public BigDecimal amount() { /** * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -227,7 +226,7 @@ public String currency() { /** * Get the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ public String reservationOrderName() { @@ -236,7 +235,7 @@ public String reservationOrderName() { /** * Get the purchasingEnrollment property: The purchasing enrollment. - * + * * @return the purchasingEnrollment value. */ public String purchasingEnrollment() { @@ -245,7 +244,7 @@ public String purchasingEnrollment() { /** * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { @@ -254,7 +253,7 @@ public UUID purchasingSubscriptionGuid() { /** * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { @@ -264,7 +263,7 @@ public String purchasingSubscriptionName() { /** * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ public String armSkuName() { @@ -273,7 +272,7 @@ public String armSkuName() { /** * Get the term property: This is the term of the transaction. - * + * * @return the term value. */ public String term() { @@ -282,7 +281,7 @@ public String term() { /** * Get the region property: The region of the transaction. - * + * * @return the region value. */ public String region() { @@ -291,7 +290,7 @@ public String region() { /** * Get the accountName property: The name of the account that makes the transaction. - * + * * @return the accountName value. */ public String accountName() { @@ -300,7 +299,7 @@ public String accountName() { /** * Get the accountOwnerEmail property: The email of the account owner that makes the transaction. - * + * * @return the accountOwnerEmail value. */ public String accountOwnerEmail() { @@ -309,7 +308,7 @@ public String accountOwnerEmail() { /** * Get the departmentName property: The department name. - * + * * @return the departmentName value. */ public String departmentName() { @@ -319,7 +318,7 @@ public String departmentName() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -328,7 +327,7 @@ public String costCenter() { /** * Get the currentEnrollment property: The current enrollment. - * + * * @return the currentEnrollment value. */ public String currentEnrollment() { @@ -337,7 +336,7 @@ public String currentEnrollment() { /** * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ public String billingFrequency() { @@ -346,7 +345,7 @@ public String billingFrequency() { /** * Get the billingMonth property: The billing month(yyyyMMdd), on which the event initiated. - * + * * @return the billingMonth value. */ public Integer billingMonth() { @@ -355,7 +354,7 @@ public Integer billingMonth() { /** * Get the monetaryCommitment property: The monetary commitment amount at the enrollment scope. - * + * * @return the monetaryCommitment value. */ public BigDecimal monetaryCommitment() { @@ -364,7 +363,7 @@ public BigDecimal monetaryCommitment() { /** * Get the overage property: The overage amount at the enrollment scope. - * + * * @return the overage value. */ public BigDecimal overage() { @@ -373,7 +372,7 @@ public BigDecimal overage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LegacyUsageDetailProperties.java index 39b1dfa8f812..1d8b584679d9 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,20 +5,18 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.models.MeterDetailsResponse; import com.azure.resourcemanager.consumption.models.PricingModelType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** The properties of the legacy usage detail. */ +/** + * 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 +84,25 @@ 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,7 @@ 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 +174,7 @@ 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 +186,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 +198,13 @@ 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 +234,7 @@ 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 +258,13 @@ 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,15 +275,33 @@ 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. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -314,7 +310,7 @@ public String billingAccountId() { /** * Get the billingAccountName property: Billing Account Name. - * + * * @return the billingAccountName value. */ public String billingAccountName() { @@ -323,7 +319,7 @@ public String billingAccountName() { /** * Get the billingPeriodStartDate property: The billing period start date. - * + * * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { @@ -332,7 +328,7 @@ public OffsetDateTime billingPeriodStartDate() { /** * Get the billingPeriodEndDate property: The billing period end date. - * + * * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { @@ -341,7 +337,7 @@ public OffsetDateTime billingPeriodEndDate() { /** * Get the billingProfileId property: Billing Profile identifier. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -350,7 +346,7 @@ public String billingProfileId() { /** * Get the billingProfileName property: Billing Profile Name. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -359,7 +355,7 @@ public String billingProfileName() { /** * Get the accountOwnerId property: Account Owner Id. - * + * * @return the accountOwnerId value. */ public String accountOwnerId() { @@ -368,7 +364,7 @@ public String accountOwnerId() { /** * Get the accountName property: Account Name. - * + * * @return the accountName value. */ public String accountName() { @@ -377,7 +373,7 @@ public String accountName() { /** * Get the subscriptionId property: Subscription guid. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -386,7 +382,7 @@ public String subscriptionId() { /** * Get the subscriptionName property: Subscription name. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -395,7 +391,7 @@ public String subscriptionName() { /** * Get the date property: Date for the usage record. - * + * * @return the date value. */ public OffsetDateTime date() { @@ -404,7 +400,7 @@ public OffsetDateTime date() { /** * Get the product property: Product name for the consumed service or purchase. Not available for Marketplace. - * + * * @return the product value. */ public String product() { @@ -414,7 +410,7 @@ public String product() { /** * Get the partNumber property: Part Number of the service used. Can be used to join with the price sheet. Not * available for marketplace. - * + * * @return the partNumber value. */ public String partNumber() { @@ -425,7 +421,7 @@ public String partNumber() { * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the * reservation is purchased see productOrderName. - * + * * @return the meterId value. */ public UUID meterId() { @@ -435,7 +431,7 @@ public UUID meterId() { /** * Get the meterDetails property: The details about the meter. By default this is not populated, unless it's * specified in $expand. - * + * * @return the meterDetails value. */ public MeterDetailsResponse meterDetails() { @@ -444,7 +440,7 @@ public MeterDetailsResponse meterDetails() { /** * Get the quantity property: The usage quantity. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -453,7 +449,7 @@ public BigDecimal quantity() { /** * Get the effectivePrice property: Effective Price that's charged for the usage. - * + * * @return the effectivePrice value. */ public BigDecimal effectivePrice() { @@ -462,7 +458,7 @@ public BigDecimal effectivePrice() { /** * Get the cost property: The amount of cost before tax. - * + * * @return the cost value. */ public BigDecimal cost() { @@ -471,7 +467,7 @@ public BigDecimal cost() { /** * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). - * + * * @return the unitPrice value. */ public BigDecimal unitPrice() { @@ -480,7 +476,7 @@ public BigDecimal unitPrice() { /** * Get the billingCurrency property: Billing Currency. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -489,7 +485,7 @@ public String billingCurrency() { /** * Get the resourceLocation property: Resource Location. - * + * * @return the resourceLocation value. */ public String resourceLocation() { @@ -499,7 +495,7 @@ public String resourceLocation() { /** * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage * or was purchased. This value is not provided for marketplace usage. - * + * * @return the consumedService value. */ public String consumedService() { @@ -508,7 +504,7 @@ public String consumedService() { /** * Get the resourceId property: Unique identifier of the Azure Resource Manager usage detail resource. - * + * * @return the resourceId value. */ public String resourceId() { @@ -517,7 +513,7 @@ public String resourceId() { /** * Get the resourceName property: Resource Name. - * + * * @return the resourceName value. */ public String resourceName() { @@ -526,7 +522,7 @@ public String resourceName() { /** * Get the serviceInfo1 property: Service-specific metadata. - * + * * @return the serviceInfo1 value. */ public String serviceInfo1() { @@ -535,7 +531,7 @@ public String serviceInfo1() { /** * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. - * + * * @return the serviceInfo2 value. */ public String serviceInfo2() { @@ -546,7 +542,7 @@ public String serviceInfo2() { * Get the additionalInfo property: Additional details of this usage item. By default this is not populated, unless * it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size * (ServiceType) or the ratio in which the reservation discount is applied. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -555,7 +551,7 @@ public String additionalInfo() { /** * Get the invoiceSection property: Invoice Section Name. - * + * * @return the invoiceSection value. */ public String invoiceSection() { @@ -565,7 +561,7 @@ public String invoiceSection() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -574,7 +570,7 @@ public String costCenter() { /** * Get the resourceGroup property: Resource Group Name. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -584,7 +580,7 @@ public String resourceGroup() { /** * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to * reservations. - * + * * @return the reservationId value. */ public String reservationId() { @@ -594,7 +590,7 @@ public String reservationId() { /** * Get the reservationName property: User provided display name of the reservation. Last known name for a particular * day is populated in the daily data. Only applies to records relevant to reservations. - * + * * @return the reservationName value. */ public String reservationName() { @@ -603,7 +599,7 @@ public String reservationName() { /** * Get the productOrderId property: Product Order Id. For reservations this is the Reservation Order ID. - * + * * @return the productOrderId value. */ public String productOrderId() { @@ -612,7 +608,7 @@ public String productOrderId() { /** * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. - * + * * @return the productOrderName value. */ public String productOrderName() { @@ -621,7 +617,7 @@ public String productOrderName() { /** * Get the offerId property: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. - * + * * @return the offerId value. */ public String offerId() { @@ -630,7 +626,7 @@ public String offerId() { /** * Get the isAzureCreditEligible property: Is Azure Credit Eligible. - * + * * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { @@ -640,7 +636,7 @@ public Boolean isAzureCreditEligible() { /** * Get the term property: Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year * reservation. 36 months for a 3 year reservation. - * + * * @return the term value. */ public String term() { @@ -649,7 +645,7 @@ public String term() { /** * Get the publisherName property: Publisher Name. - * + * * @return the publisherName value. */ public String publisherName() { @@ -658,7 +654,7 @@ public String publisherName() { /** * Get the publisherType property: Publisher Type. - * + * * @return the publisherType value. */ public String publisherType() { @@ -667,7 +663,7 @@ public String publisherType() { /** * Get the planName property: Plan Name. - * + * * @return the planName value. */ public String planName() { @@ -677,7 +673,7 @@ public String planName() { /** * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation * fee, or a refund. - * + * * @return the chargeType value. */ public String chargeType() { @@ -688,7 +684,7 @@ public String chargeType() { * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is * used. - * + * * @return the frequency value. */ public String frequency() { @@ -697,16 +693,34 @@ public String frequency() { /** * Get the payGPrice property: Retail price for the resource. - * + * * @return the payGPrice value. */ public BigDecimal payGPrice() { return this.payGPrice; } + /** + * Get the benefitId property: Unique identifier for the applicable benefit. + * + * @return the benefitId value. + */ + public String benefitId() { + return this.benefitId; + } + + /** + * Get the benefitName property: Name of the applicable benefit. + * + * @return the benefitName value. + */ + public String benefitName() { + return this.benefitName; + } + /** * Get the pricingModel property: Identifier that indicates how the meter is priced. - * + * * @return the pricingModel value. */ public PricingModelType pricingModel() { @@ -715,7 +729,7 @@ public PricingModelType pricingModel() { /** * 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/LotProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotProperties.java index 6849ba86cdac..0b599447a346 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,23 +5,22 @@ 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.OrganizationType; 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. */ +/** + * The lot properties. + */ @Immutable public final class LotProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LotProperties.class); - /* - * The original amount of a lot. + * The original amount of a lot, Note: This will not be returned for Contributor Organization Type in Multi-Entity consumption commitment */ @JsonProperty(value = "originalAmount", access = JsonProperty.Access.WRITE_ONLY) private Amount originalAmount; @@ -51,8 +50,7 @@ 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; @@ -82,7 +80,7 @@ public final class LotProperties { private String billingCurrency; /* - * The original amount of a lot in billing currency. + * The original amount of a lot in billing currency, Note: This will not be returned for Contributor Organization Type in Multi-Entity consumption commitment */ @JsonProperty(value = "originalAmountInBillingCurrency", access = JsonProperty.Access.WRITE_ONLY) private AmountWithExchangeRate originalAmountInBillingCurrency; @@ -99,15 +97,40 @@ 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; + /* + * The organization type of the lot. + */ + @JsonProperty(value = "OrganizationType", access = JsonProperty.Access.WRITE_ONLY) + private OrganizationType organizationType; + + /* + * Amount consumed from the commitment. + */ + @JsonProperty(value = "usedAmount", access = JsonProperty.Access.WRITE_ONLY) + private Amount usedAmount; + + /** + * Creates an instance of LotProperties class. + */ + public LotProperties() { + } + /** - * Get the originalAmount property: The original amount of a lot. - * + * Get the originalAmount property: The original amount of a lot, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmount value. */ public Amount originalAmount() { @@ -116,7 +139,7 @@ public Amount originalAmount() { /** * Get the closedBalance property: The balance as of the last invoice. - * + * * @return the closedBalance value. */ public Amount closedBalance() { @@ -125,7 +148,7 @@ public Amount closedBalance() { /** * Get the source property: The source of the lot. - * + * * @return the source value. */ public LotSource source() { @@ -134,7 +157,7 @@ public LotSource source() { /** * Get the startDate property: The date when the lot became effective. - * + * * @return the startDate value. */ public OffsetDateTime startDate() { @@ -143,7 +166,7 @@ public OffsetDateTime startDate() { /** * Get the expirationDate property: The expiration date of a lot. - * + * * @return the expirationDate value. */ public OffsetDateTime expirationDate() { @@ -153,7 +176,7 @@ public OffsetDateTime expirationDate() { /** * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not * available for ConsumptionCommitment lots. - * + * * @return the poNumber value. */ public String poNumber() { @@ -162,7 +185,7 @@ public String poNumber() { /** * Get the purchasedDate property: The date when the lot was added. - * + * * @return the purchasedDate value. */ public OffsetDateTime purchasedDate() { @@ -171,7 +194,7 @@ public OffsetDateTime purchasedDate() { /** * Get the status property: The status of the lot. - * + * * @return the status value. */ public Status status() { @@ -180,7 +203,7 @@ public Status status() { /** * Get the creditCurrency property: The currency of the lot. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -189,7 +212,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency of the lot. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -197,8 +220,9 @@ public String billingCurrency() { } /** - * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. - * + * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency, Note: This + * will not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmountInBillingCurrency value. */ public AmountWithExchangeRate originalAmountInBillingCurrency() { @@ -207,7 +231,7 @@ public AmountWithExchangeRate originalAmountInBillingCurrency() { /** * Get the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. - * + * * @return the closedBalanceInBillingCurrency value. */ public AmountWithExchangeRate closedBalanceInBillingCurrency() { @@ -216,25 +240,53 @@ public AmountWithExchangeRate closedBalanceInBillingCurrency() { /** * Get the reseller property: The reseller of the lot. - * + * * @return the reseller value. */ 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. - * + * * @return the etag value. */ public String etag() { return this.etag; } + /** + * Get the organizationType property: The organization type of the lot. + * + * @return the organizationType value. + */ + public OrganizationType organizationType() { + return this.organizationType; + } + + /** + * Get the usedAmount property: Amount consumed from the commitment. + * + * @return the usedAmount value. + */ + public Amount usedAmount() { + return this.usedAmount; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { @@ -253,5 +305,8 @@ public void validate() { if (reseller() != null) { reseller().validate(); } + if (usedAmount() != null) { + usedAmount().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/LotSummaryInner.java index 66ba7de656ca..244db2d8f4c7 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,20 @@ 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.OrganizationType; 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. */ +/** + * A lot summary resource. + */ @Fluent public final class LotSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LotSummaryInner.class); - /* * The lot properties. */ @@ -28,16 +27,20 @@ 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. - * + * * @return the innerProperties value. */ private LotProperties innerProperties() { @@ -47,7 +50,7 @@ private LotProperties innerProperties() { /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ public String etag() { @@ -57,7 +60,7 @@ public String etag() { /** * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @param etag the etag value to set. * @return the LotSummaryInner object itself. */ @@ -67,8 +70,9 @@ public LotSummaryInner withEtag(String etag) { } /** - * Get the originalAmount property: The original amount of a lot. - * + * Get the originalAmount property: The original amount of a lot, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmount value. */ public Amount originalAmount() { @@ -77,7 +81,7 @@ public Amount originalAmount() { /** * Get the closedBalance property: The balance as of the last invoice. - * + * * @return the closedBalance value. */ public Amount closedBalance() { @@ -86,7 +90,7 @@ public Amount closedBalance() { /** * Get the source property: The source of the lot. - * + * * @return the source value. */ public LotSource source() { @@ -95,7 +99,7 @@ public LotSource source() { /** * Get the startDate property: The date when the lot became effective. - * + * * @return the startDate value. */ public OffsetDateTime startDate() { @@ -104,7 +108,7 @@ public OffsetDateTime startDate() { /** * Get the expirationDate property: The expiration date of a lot. - * + * * @return the expirationDate value. */ public OffsetDateTime expirationDate() { @@ -114,7 +118,7 @@ public OffsetDateTime expirationDate() { /** * Get the poNumber property: The po number of the invoice on which the lot was added. This property is not * available for ConsumptionCommitment lots. - * + * * @return the poNumber value. */ public String poNumber() { @@ -123,7 +127,7 @@ public String poNumber() { /** * Get the purchasedDate property: The date when the lot was added. - * + * * @return the purchasedDate value. */ public OffsetDateTime purchasedDate() { @@ -132,7 +136,7 @@ public OffsetDateTime purchasedDate() { /** * Get the status property: The status of the lot. - * + * * @return the status value. */ public Status status() { @@ -141,7 +145,7 @@ public Status status() { /** * Get the creditCurrency property: The currency of the lot. - * + * * @return the creditCurrency value. */ public String creditCurrency() { @@ -150,7 +154,7 @@ public String creditCurrency() { /** * Get the billingCurrency property: The billing currency of the lot. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -158,8 +162,9 @@ public String billingCurrency() { } /** - * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. - * + * Get the originalAmountInBillingCurrency property: The original amount of a lot in billing currency, Note: This + * will not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmountInBillingCurrency value. */ public AmountWithExchangeRate originalAmountInBillingCurrency() { @@ -168,7 +173,7 @@ public AmountWithExchangeRate originalAmountInBillingCurrency() { /** * Get the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. - * + * * @return the closedBalanceInBillingCurrency value. */ public AmountWithExchangeRate closedBalanceInBillingCurrency() { @@ -177,25 +182,53 @@ public AmountWithExchangeRate closedBalanceInBillingCurrency() { /** * Get the reseller property: The reseller of the lot. - * + * * @return the reseller value. */ public Reseller reseller() { return this.innerProperties() == null ? null : this.innerProperties().reseller(); } + /** + * Get the 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. - * + * * @return the etag value. */ public String etagPropertiesEtag() { return this.innerProperties() == null ? null : this.innerProperties().etag(); } + /** + * Get the organizationType property: The organization type of the lot. + * + * @return the organizationType value. + */ + public OrganizationType organizationType() { + return this.innerProperties() == null ? null : this.innerProperties().organizationType(); + } + + /** + * Get the usedAmount property: Amount consumed from the commitment. + * + * @return the usedAmount value. + */ + public Amount usedAmount() { + return this.innerProperties() == null ? null : this.innerProperties().usedAmount(); + } + /** * 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/ManagementGroupAggregatedCostProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ManagementGroupAggregatedCostProperties.java index de916d475acc..643a9ad843f3 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,21 +5,18 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.List; -/** The properties of the Management Group Aggregated Cost. */ +/** + * 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,22 +64,26 @@ 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. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -91,7 +92,7 @@ public String billingPeriodId() { /** * Get the usageStart property: The start of the date time range covered by aggregated cost. - * + * * @return the usageStart value. */ public OffsetDateTime usageStart() { @@ -100,7 +101,7 @@ public OffsetDateTime usageStart() { /** * Get the usageEnd property: The end of the date time range covered by the aggregated cost. - * + * * @return the usageEnd value. */ public OffsetDateTime usageEnd() { @@ -109,7 +110,7 @@ public OffsetDateTime usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public BigDecimal azureCharges() { @@ -118,7 +119,7 @@ public BigDecimal azureCharges() { /** * Get the marketplaceCharges property: Marketplace Charges. - * + * * @return the marketplaceCharges value. */ public BigDecimal marketplaceCharges() { @@ -127,7 +128,7 @@ public BigDecimal marketplaceCharges() { /** * Get the chargesBilledSeparately property: Charges Billed Separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -136,7 +137,7 @@ public BigDecimal chargesBilledSeparately() { /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -145,7 +146,7 @@ public String currency() { /** * Get the children property: Children of a management group. - * + * * @return the children value. */ public List children() { @@ -154,12 +155,12 @@ public List children() { /** * Set the children property: Children of a management group. - * + * * @param children the children value to set. * @return the ManagementGroupAggregatedCostProperties object itself. */ - public ManagementGroupAggregatedCostProperties withChildren( - List children) { + public ManagementGroupAggregatedCostProperties + withChildren(List children) { this.children = children; return this; } @@ -167,7 +168,7 @@ public ManagementGroupAggregatedCostProperties withChildren( /** * Get the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated * cost. - * + * * @return the includedSubscriptions value. */ public List includedSubscriptions() { @@ -177,7 +178,7 @@ public List includedSubscriptions() { /** * Set the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated * cost. - * + * * @param includedSubscriptions the includedSubscriptions value to set. * @return the ManagementGroupAggregatedCostProperties object itself. */ @@ -189,7 +190,7 @@ public ManagementGroupAggregatedCostProperties withIncludedSubscriptions(List excludedSubscriptions() { @@ -199,7 +200,7 @@ public List excludedSubscriptions() { /** * Set the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated * cost. - * + * * @param excludedSubscriptions the excludedSubscriptions value to set. * @return the ManagementGroupAggregatedCostProperties object itself. */ @@ -210,7 +211,7 @@ public ManagementGroupAggregatedCostProperties withExcludedSubscriptions(List tags; + /** + * Creates an instance of ManagementGroupAggregatedCostResultInner class. + */ + public ManagementGroupAggregatedCostResultInner() { + } + /** * Get the innerProperties property: The properties of the Management Group Aggregated Cost. - * + * * @return the innerProperties value. */ private ManagementGroupAggregatedCostProperties innerProperties() { @@ -50,7 +54,7 @@ private ManagementGroupAggregatedCostProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -59,7 +63,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -68,7 +72,7 @@ public Map tags() { /** * Get the billingPeriodId property: The id of the billing period resource that the aggregated cost belongs to. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -77,7 +81,7 @@ public String billingPeriodId() { /** * Get the usageStart property: The start of the date time range covered by aggregated cost. - * + * * @return the usageStart value. */ public OffsetDateTime usageStart() { @@ -86,7 +90,7 @@ public OffsetDateTime usageStart() { /** * Get the usageEnd property: The end of the date time range covered by the aggregated cost. - * + * * @return the usageEnd value. */ public OffsetDateTime usageEnd() { @@ -95,7 +99,7 @@ public OffsetDateTime usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public BigDecimal azureCharges() { @@ -104,7 +108,7 @@ public BigDecimal azureCharges() { /** * Get the marketplaceCharges property: Marketplace Charges. - * + * * @return the marketplaceCharges value. */ public BigDecimal marketplaceCharges() { @@ -113,7 +117,7 @@ public BigDecimal marketplaceCharges() { /** * Get the chargesBilledSeparately property: Charges Billed Separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -122,7 +126,7 @@ public BigDecimal chargesBilledSeparately() { /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -131,7 +135,7 @@ public String currency() { /** * Get the children property: Children of a management group. - * + * * @return the children value. */ public List children() { @@ -140,12 +144,12 @@ public List children() { /** * Set the children property: Children of a management group. - * + * * @param children the children value to set. * @return the ManagementGroupAggregatedCostResultInner object itself. */ - public ManagementGroupAggregatedCostResultInner withChildren( - List children) { + public ManagementGroupAggregatedCostResultInner + withChildren(List children) { if (this.innerProperties() == null) { this.innerProperties = new ManagementGroupAggregatedCostProperties(); } @@ -156,7 +160,7 @@ public ManagementGroupAggregatedCostResultInner withChildren( /** * Get the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated * cost. - * + * * @return the includedSubscriptions value. */ public List includedSubscriptions() { @@ -166,7 +170,7 @@ public List includedSubscriptions() { /** * Set the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated * cost. - * + * * @param includedSubscriptions the includedSubscriptions value to set. * @return the ManagementGroupAggregatedCostResultInner object itself. */ @@ -181,7 +185,7 @@ public ManagementGroupAggregatedCostResultInner withIncludedSubscriptions(List excludedSubscriptions() { @@ -191,7 +195,7 @@ public List excludedSubscriptions() { /** * Set the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated * cost. - * + * * @param excludedSubscriptions the excludedSubscriptions value to set. * @return the ManagementGroupAggregatedCostResultInner object itself. */ @@ -205,7 +209,7 @@ public ManagementGroupAggregatedCostResultInner withExcludedSubscriptions(List tags; + /** + * Creates an instance of MarketplaceInner class. + */ + public MarketplaceInner() { + } + /** * Get the innerProperties property: The properties of the marketplace usage detail. - * + * * @return the innerProperties value. */ private MarketplaceProperties innerProperties() { @@ -50,7 +54,7 @@ private MarketplaceProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -59,7 +63,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -68,7 +72,7 @@ public Map tags() { /** * Get the billingPeriodId property: The id of the billing period resource that the usage belongs to. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -77,7 +81,7 @@ public String billingPeriodId() { /** * Get the usageStart property: The start of the date time range covered by the usage detail. - * + * * @return the usageStart value. */ public OffsetDateTime usageStart() { @@ -86,7 +90,7 @@ public OffsetDateTime usageStart() { /** * Get the usageEnd property: The end of the date time range covered by the usage detail. - * + * * @return the usageEnd value. */ public OffsetDateTime usageEnd() { @@ -95,7 +99,7 @@ public OffsetDateTime usageEnd() { /** * Get the resourceRate property: The marketplace resource rate. - * + * * @return the resourceRate value. */ public BigDecimal resourceRate() { @@ -104,7 +108,7 @@ public BigDecimal resourceRate() { /** * Get the offerName property: The type of offer. - * + * * @return the offerName value. */ public String offerName() { @@ -113,7 +117,7 @@ public String offerName() { /** * Get the resourceGroup property: The name of resource group. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -122,7 +126,7 @@ public String resourceGroup() { /** * Get the additionalInfo property: Additional information. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -131,7 +135,7 @@ public String additionalInfo() { /** * Get the orderNumber property: The order number. - * + * * @return the orderNumber value. */ public String orderNumber() { @@ -140,7 +144,7 @@ public String orderNumber() { /** * Get the instanceName property: The name of the resource instance that the usage is about. - * + * * @return the instanceName value. */ public String instanceName() { @@ -149,7 +153,7 @@ public String instanceName() { /** * Get the instanceId property: The uri of the resource instance that the usage is about. - * + * * @return the instanceId value. */ public String instanceId() { @@ -158,7 +162,7 @@ public String instanceId() { /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -167,7 +171,7 @@ public String currency() { /** * Get the consumedQuantity property: The quantity of usage. - * + * * @return the consumedQuantity value. */ public BigDecimal consumedQuantity() { @@ -176,7 +180,7 @@ public BigDecimal consumedQuantity() { /** * Get the unitOfMeasure property: The unit of measure. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -185,7 +189,7 @@ public String unitOfMeasure() { /** * Get the pretaxCost property: The amount of cost before tax. - * + * * @return the pretaxCost value. */ public BigDecimal pretaxCost() { @@ -194,7 +198,7 @@ public BigDecimal pretaxCost() { /** * Get the isEstimated property: The estimated usage is subject to change. - * + * * @return the isEstimated value. */ public Boolean isEstimated() { @@ -203,7 +207,7 @@ public Boolean isEstimated() { /** * Get the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ public UUID meterId() { @@ -212,7 +216,7 @@ public UUID meterId() { /** * Get the subscriptionGuid property: Subscription guid. - * + * * @return the subscriptionGuid value. */ public UUID subscriptionGuid() { @@ -221,7 +225,7 @@ public UUID subscriptionGuid() { /** * Get the subscriptionName property: Subscription name. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -230,7 +234,7 @@ public String subscriptionName() { /** * Get the accountName property: Account name. - * + * * @return the accountName value. */ public String accountName() { @@ -239,7 +243,7 @@ public String accountName() { /** * Get the departmentName property: Department name. - * + * * @return the departmentName value. */ public String departmentName() { @@ -248,7 +252,7 @@ public String departmentName() { /** * Get the consumedService property: Consumed service name. - * + * * @return the consumedService value. */ public String consumedService() { @@ -257,7 +261,7 @@ public String consumedService() { /** * Get the costCenter property: The cost center of this department if it is a department and a costcenter exists. - * + * * @return the costCenter value. */ public String costCenter() { @@ -267,7 +271,7 @@ public String costCenter() { /** * Get the additionalProperties property: Additional details of this usage item. By default this is not populated, * unless it's specified in $expand. - * + * * @return the additionalProperties value. */ public String additionalProperties() { @@ -276,7 +280,7 @@ public String additionalProperties() { /** * Get the publisherName property: The name of publisher. - * + * * @return the publisherName value. */ public String publisherName() { @@ -285,7 +289,7 @@ public String publisherName() { /** * Get the planName property: The name of plan. - * + * * @return the planName value. */ public String planName() { @@ -294,7 +298,7 @@ public String planName() { /** * Get the isRecurringCharge property: Flag indicating whether this is a recurring charge or not. - * + * * @return the isRecurringCharge value. */ public Boolean isRecurringCharge() { @@ -303,7 +307,7 @@ public Boolean isRecurringCharge() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/MarketplaceProperties.java index 006420b0220a..ff7ae99d5196 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,18 +5,16 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** The properties of the marketplace usage detail. */ +/** + * 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 +142,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,9 +171,15 @@ 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. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -186,7 +188,7 @@ public String billingPeriodId() { /** * Get the usageStart property: The start of the date time range covered by the usage detail. - * + * * @return the usageStart value. */ public OffsetDateTime usageStart() { @@ -195,7 +197,7 @@ public OffsetDateTime usageStart() { /** * Get the usageEnd property: The end of the date time range covered by the usage detail. - * + * * @return the usageEnd value. */ public OffsetDateTime usageEnd() { @@ -204,7 +206,7 @@ public OffsetDateTime usageEnd() { /** * Get the resourceRate property: The marketplace resource rate. - * + * * @return the resourceRate value. */ public BigDecimal resourceRate() { @@ -213,7 +215,7 @@ public BigDecimal resourceRate() { /** * Get the offerName property: The type of offer. - * + * * @return the offerName value. */ public String offerName() { @@ -222,7 +224,7 @@ public String offerName() { /** * Get the resourceGroup property: The name of resource group. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -231,7 +233,7 @@ public String resourceGroup() { /** * Get the additionalInfo property: Additional information. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -240,7 +242,7 @@ public String additionalInfo() { /** * Get the orderNumber property: The order number. - * + * * @return the orderNumber value. */ public String orderNumber() { @@ -249,7 +251,7 @@ public String orderNumber() { /** * Get the instanceName property: The name of the resource instance that the usage is about. - * + * * @return the instanceName value. */ public String instanceName() { @@ -258,7 +260,7 @@ public String instanceName() { /** * Get the instanceId property: The uri of the resource instance that the usage is about. - * + * * @return the instanceId value. */ public String instanceId() { @@ -267,7 +269,7 @@ public String instanceId() { /** * Get the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -276,7 +278,7 @@ public String currency() { /** * Get the consumedQuantity property: The quantity of usage. - * + * * @return the consumedQuantity value. */ public BigDecimal consumedQuantity() { @@ -285,7 +287,7 @@ public BigDecimal consumedQuantity() { /** * Get the unitOfMeasure property: The unit of measure. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -294,7 +296,7 @@ public String unitOfMeasure() { /** * Get the pretaxCost property: The amount of cost before tax. - * + * * @return the pretaxCost value. */ public BigDecimal pretaxCost() { @@ -303,7 +305,7 @@ public BigDecimal pretaxCost() { /** * Get the isEstimated property: The estimated usage is subject to change. - * + * * @return the isEstimated value. */ public Boolean isEstimated() { @@ -312,7 +314,7 @@ public Boolean isEstimated() { /** * Get the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ public UUID meterId() { @@ -321,7 +323,7 @@ public UUID meterId() { /** * Get the subscriptionGuid property: Subscription guid. - * + * * @return the subscriptionGuid value. */ public UUID subscriptionGuid() { @@ -330,7 +332,7 @@ public UUID subscriptionGuid() { /** * Get the subscriptionName property: Subscription name. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -339,7 +341,7 @@ public String subscriptionName() { /** * Get the accountName property: Account name. - * + * * @return the accountName value. */ public String accountName() { @@ -348,7 +350,7 @@ public String accountName() { /** * Get the departmentName property: Department name. - * + * * @return the departmentName value. */ public String departmentName() { @@ -357,7 +359,7 @@ public String departmentName() { /** * Get the consumedService property: Consumed service name. - * + * * @return the consumedService value. */ public String consumedService() { @@ -366,7 +368,7 @@ public String consumedService() { /** * Get the costCenter property: The cost center of this department if it is a department and a costcenter exists. - * + * * @return the costCenter value. */ public String costCenter() { @@ -376,7 +378,7 @@ public String costCenter() { /** * Get the additionalProperties property: Additional details of this usage item. By default this is not populated, * unless it's specified in $expand. - * + * * @return the additionalProperties value. */ public String additionalProperties() { @@ -385,7 +387,7 @@ public String additionalProperties() { /** * Get the publisherName property: The name of publisher. - * + * * @return the publisherName value. */ public String publisherName() { @@ -394,7 +396,7 @@ public String publisherName() { /** * Get the planName property: The name of plan. - * + * * @return the planName value. */ public String planName() { @@ -403,7 +405,7 @@ public String planName() { /** * Get the isRecurringCharge property: Flag indicating whether this is a recurring charge or not. - * + * * @return the isRecurringCharge value. */ public Boolean isRecurringCharge() { @@ -412,7 +414,7 @@ public Boolean isRecurringCharge() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernChargeSummaryProperties.java index 9a5a2f9e026a..31b9ed42e612 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,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.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; -/** The properties of modern charge summary. */ +/** + * 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,9 +79,21 @@ 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. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -92,7 +102,7 @@ public String billingPeriodId() { /** * Get the usageStart property: Usage start date. - * + * * @return the usageStart value. */ public String usageStart() { @@ -101,7 +111,7 @@ public String usageStart() { /** * Get the usageEnd property: Usage end date. - * + * * @return the usageEnd value. */ public String usageEnd() { @@ -110,7 +120,7 @@ public String usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public Amount azureCharges() { @@ -119,7 +129,7 @@ public Amount azureCharges() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public Amount chargesBilledSeparately() { @@ -128,7 +138,7 @@ public Amount chargesBilledSeparately() { /** * Get the marketplaceCharges property: Marketplace Charges. - * + * * @return the marketplaceCharges value. */ public Amount marketplaceCharges() { @@ -137,7 +147,7 @@ public Amount marketplaceCharges() { /** * Get the billingAccountId property: Billing Account Id. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -146,7 +156,7 @@ public String billingAccountId() { /** * Get the billingProfileId property: Billing Profile Id. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -155,7 +165,7 @@ public String billingProfileId() { /** * Get the invoiceSectionId property: Invoice Section Id. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -164,7 +174,7 @@ public String invoiceSectionId() { /** * Get the customerId property: Customer Id. - * + * * @return the customerId value. */ public String customerId() { @@ -173,16 +183,25 @@ public String customerId() { /** * Get the isInvoiced property: Is charge Invoiced. - * + * * @return the isInvoiced value. */ 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. - * + * * @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/ModernReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionInner.java index 636c1f94bcf5..274f22ec521b 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,29 +4,34 @@ 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 +/** + * Modern Reservation transaction resource. + */ +@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. - * + * * @return the innerProperties value. */ private ModernReservationTransactionProperties innerProperties() { @@ -35,7 +40,7 @@ private ModernReservationTransactionProperties innerProperties() { /** * Get the amount property: The charge of the transaction. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -45,7 +50,7 @@ public BigDecimal amount() { /** * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ public String armSkuName() { @@ -54,7 +59,7 @@ public String armSkuName() { /** * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ public String billingFrequency() { @@ -63,7 +68,7 @@ public String billingFrequency() { /** * Get the billingProfileId property: Billing profile Id. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -72,7 +77,7 @@ public String billingProfileId() { /** * Get the billingProfileName property: Billing profile name. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -81,7 +86,7 @@ public String billingProfileName() { /** * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -90,7 +95,7 @@ public String currency() { /** * Get the description property: The description of the transaction. - * + * * @return the description value. */ public String description() { @@ -99,7 +104,7 @@ public String description() { /** * Get the eventDate property: The date of the transaction. - * + * * @return the eventDate value. */ public OffsetDateTime eventDate() { @@ -107,8 +112,8 @@ 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. */ public String eventType() { @@ -117,7 +122,7 @@ public String eventType() { /** * Get the invoice property: Invoice Number. - * + * * @return the invoice value. */ public String invoice() { @@ -126,7 +131,7 @@ public String invoice() { /** * Get the invoiceId property: Invoice Id as on the invoice where the specific transaction appears. - * + * * @return the invoiceId value. */ public String invoiceId() { @@ -135,7 +140,7 @@ public String invoiceId() { /** * Get the invoiceSectionId property: Invoice Section Id. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -144,7 +149,7 @@ public String invoiceSectionId() { /** * Get the invoiceSectionName property: Invoice Section Name. - * + * * @return the invoiceSectionName value. */ public String invoiceSectionName() { @@ -153,7 +158,7 @@ public String invoiceSectionName() { /** * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { @@ -162,7 +167,7 @@ public UUID purchasingSubscriptionGuid() { /** * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { @@ -171,7 +176,7 @@ public String purchasingSubscriptionName() { /** * Get the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -180,7 +185,7 @@ public BigDecimal quantity() { /** * Get the region property: The region of the transaction. - * + * * @return the region value. */ public String region() { @@ -191,7 +196,7 @@ public String region() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -200,7 +205,7 @@ public String reservationOrderId() { /** * Get the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ public String reservationOrderName() { @@ -209,7 +214,7 @@ public String reservationOrderName() { /** * Get the term property: This is the term of the transaction. - * + * * @return the term value. */ public String term() { @@ -218,19 +223,20 @@ public String term() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ModernReservationTransactionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ModernReservationTransactionInner")); } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernReservationTransactionInner.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernReservationTransactionProperties.java index fb749b85a558..919c51b3ad90 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,18 +5,16 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** The properties of a modern reservation transaction. */ +/** + * 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 +22,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 +64,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 +118,7 @@ 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,9 +135,15 @@ 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. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -153,7 +153,7 @@ public BigDecimal amount() { /** * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ public String armSkuName() { @@ -162,7 +162,7 @@ public String armSkuName() { /** * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ public String billingFrequency() { @@ -171,7 +171,7 @@ public String billingFrequency() { /** * Get the billingProfileId property: Billing profile Id. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -180,7 +180,7 @@ public String billingProfileId() { /** * Get the billingProfileName property: Billing profile name. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -189,7 +189,7 @@ public String billingProfileName() { /** * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -198,7 +198,7 @@ public String currency() { /** * Get the description property: The description of the transaction. - * + * * @return the description value. */ public String description() { @@ -207,7 +207,7 @@ public String description() { /** * Get the eventDate property: The date of the transaction. - * + * * @return the eventDate value. */ public OffsetDateTime eventDate() { @@ -215,8 +215,8 @@ 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. */ public String eventType() { @@ -225,7 +225,7 @@ public String eventType() { /** * Get the invoice property: Invoice Number. - * + * * @return the invoice value. */ public String invoice() { @@ -234,7 +234,7 @@ public String invoice() { /** * Get the invoiceId property: Invoice Id as on the invoice where the specific transaction appears. - * + * * @return the invoiceId value. */ public String invoiceId() { @@ -243,7 +243,7 @@ public String invoiceId() { /** * Get the invoiceSectionId property: Invoice Section Id. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -252,7 +252,7 @@ public String invoiceSectionId() { /** * Get the invoiceSectionName property: Invoice Section Name. - * + * * @return the invoiceSectionName value. */ public String invoiceSectionName() { @@ -261,7 +261,7 @@ public String invoiceSectionName() { /** * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { @@ -270,7 +270,7 @@ public UUID purchasingSubscriptionGuid() { /** * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { @@ -279,7 +279,7 @@ public String purchasingSubscriptionName() { /** * Get the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -288,7 +288,7 @@ public BigDecimal quantity() { /** * Get the region property: The region of the transaction. - * + * * @return the region value. */ public String region() { @@ -299,7 +299,7 @@ public String region() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -308,7 +308,7 @@ public String reservationOrderId() { /** * Get the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ public String reservationOrderName() { @@ -317,7 +317,7 @@ public String reservationOrderName() { /** * Get the term property: This is the term of the transaction. - * + * * @return the term value. */ public String term() { @@ -326,7 +326,7 @@ public String term() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ModernUsageDetailProperties.java index 00c64480a2cd..6a910a4689db 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,19 +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.PricingModelType; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** The properties of the usage detail. */ +/** + * The properties of the usage detail. + */ @Immutable public final class ModernUsageDetailProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetailProperties.class); - /* * Billing Account identifier. */ @@ -55,19 +53,13 @@ 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 - * entitlement purchases like SaaS, Marketplace, RI, etc. + * Name of the billing profile that groups costs across invoices in the a singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. */ @JsonProperty(value = "billingProfileName", access = JsonProperty.Access.WRITE_ONLY) private String billingProfileName; @@ -91,17 +83,13 @@ 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 +101,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 +113,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 +149,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 +167,7 @@ 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 +185,49 @@ 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 +245,31 @@ 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 +281,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 +305,7 @@ 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 +317,7 @@ 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 +329,13 @@ 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 +407,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 +437,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,9 +448,15 @@ 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. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -510,7 +465,7 @@ public String billingAccountId() { /** * Get the effectivePrice property: Effective Price that's charged for the usage. - * + * * @return the effectivePrice value. */ public BigDecimal effectivePrice() { @@ -519,7 +474,7 @@ public BigDecimal effectivePrice() { /** * Get the pricingModel property: Identifier that indicates how the meter is priced. - * + * * @return the pricingModel value. */ public PricingModelType pricingModel() { @@ -528,7 +483,7 @@ public PricingModelType pricingModel() { /** * Get the billingAccountName property: Name of the Billing Account. - * + * * @return the billingAccountName value. */ public String billingAccountName() { @@ -537,7 +492,7 @@ public String billingAccountName() { /** * Get the billingPeriodStartDate property: Billing Period Start Date as in the invoice. - * + * * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { @@ -546,7 +501,7 @@ public OffsetDateTime billingPeriodStartDate() { /** * Get the billingPeriodEndDate property: Billing Period End Date as in the invoice. - * + * * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { @@ -557,7 +512,7 @@ public OffsetDateTime billingPeriodEndDate() { * Get the billingProfileId property: Identifier for the billing profile that groups costs across invoices in the a * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -568,7 +523,7 @@ public String billingProfileId() { * Get the billingProfileName property: Name of the billing profile that groups costs across invoices in the a * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -577,7 +532,7 @@ public String billingProfileName() { /** * Get the subscriptionGuid property: Unique Microsoft generated identifier for the Azure Subscription. - * + * * @return the subscriptionGuid value. */ public String subscriptionGuid() { @@ -586,7 +541,7 @@ public String subscriptionGuid() { /** * Get the subscriptionName property: Name of the Azure Subscription. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -595,7 +550,7 @@ public String subscriptionName() { /** * Get the date property: Date for the usage record. - * + * * @return the date value. */ public OffsetDateTime date() { @@ -605,7 +560,7 @@ public OffsetDateTime date() { /** * Get the product property: Name of the product that has accrued charges by consumption or purchase as listed in * the invoice. Not available for Marketplace. - * + * * @return the product value. */ public String product() { @@ -616,7 +571,7 @@ public String product() { * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the * reservation is purchased see productOrderName. - * + * * @return the meterId value. */ public UUID meterId() { @@ -625,7 +580,7 @@ public UUID meterId() { /** * Get the meterName property: Identifies the name of the meter against which consumption is measured. - * + * * @return the meterName value. */ public String meterName() { @@ -635,7 +590,7 @@ public String meterName() { /** * Get the meterRegion property: Identifies the location of the datacenter for certain services that are priced * based on datacenter location. - * + * * @return the meterRegion value. */ public String meterRegion() { @@ -644,7 +599,7 @@ public String meterRegion() { /** * Get the meterCategory property: Identifies the top-level service for the usage. - * + * * @return the meterCategory value. */ public String meterCategory() { @@ -653,7 +608,7 @@ public String meterCategory() { /** * Get the meterSubCategory property: Defines the type or sub-category of Azure service that can affect the rate. - * + * * @return the meterSubCategory value. */ public String meterSubCategory() { @@ -663,7 +618,7 @@ public String meterSubCategory() { /** * Get the serviceFamily property: List the service family for the product purchased or charged (Example: Storage ; * Compute). - * + * * @return the serviceFamily value. */ public String serviceFamily() { @@ -673,7 +628,7 @@ public String serviceFamily() { /** * Get the quantity property: Measure the quantity purchased or consumed.The amount of the meter used during the * billing period. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -683,7 +638,7 @@ public BigDecimal quantity() { /** * Get the unitOfMeasure property: Identifies the Unit that the service is charged in. For example, GB, hours, * 10,000 s. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -692,7 +647,7 @@ public String unitOfMeasure() { /** * Get the instanceName property: Instance Name. - * + * * @return the instanceName value. */ public String instanceName() { @@ -701,7 +656,7 @@ public String instanceName() { /** * Get the costInUsd property: Estimated extendedCost or blended cost before tax in USD. - * + * * @return the costInUsd value. */ public BigDecimal costInUsd() { @@ -710,7 +665,7 @@ public BigDecimal costInUsd() { /** * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). - * + * * @return the unitPrice value. */ public BigDecimal unitPrice() { @@ -719,7 +674,7 @@ public BigDecimal unitPrice() { /** * Get the billingCurrencyCode property: The currency defining the billed cost. - * + * * @return the billingCurrencyCode value. */ public String billingCurrencyCode() { @@ -728,7 +683,7 @@ public String billingCurrencyCode() { /** * Get the resourceLocation property: Name of the resource location. - * + * * @return the resourceLocation value. */ public String resourceLocation() { @@ -738,7 +693,7 @@ public String resourceLocation() { /** * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage * or was purchased. This value is not provided for marketplace usage. - * + * * @return the consumedService value. */ public String consumedService() { @@ -747,7 +702,7 @@ public String consumedService() { /** * Get the serviceInfo1 property: Service-specific metadata. - * + * * @return the serviceInfo1 value. */ public String serviceInfo1() { @@ -756,7 +711,7 @@ public String serviceInfo1() { /** * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. - * + * * @return the serviceInfo2 value. */ public String serviceInfo2() { @@ -767,7 +722,7 @@ public String serviceInfo2() { * Get the additionalInfo property: Additional details of this usage item. Use this field to get usage line item * specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is * applied. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -777,7 +732,7 @@ public String additionalInfo() { /** * Get the invoiceSectionId property: Identifier of the project that is being charged in the invoice. Not applicable * for Microsoft Customer Agreements onboarded by partners. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -787,7 +742,7 @@ public String invoiceSectionId() { /** * Get the invoiceSectionName property: Name of the project that is being charged in the invoice. Not applicable for * Microsoft Customer Agreements onboarded by partners. - * + * * @return the invoiceSectionName value. */ public String invoiceSectionName() { @@ -797,7 +752,7 @@ public String invoiceSectionName() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -807,7 +762,7 @@ public String costCenter() { /** * Get the resourceGroup property: Name of the Azure resource group used for cohesive lifecycle management of * resources. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -817,7 +772,7 @@ public String resourceGroup() { /** * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to * reservations. - * + * * @return the reservationId value. */ public String reservationId() { @@ -827,7 +782,7 @@ public String reservationId() { /** * Get the reservationName property: User provided display name of the reservation. Last known name for a particular * day is populated in the daily data. Only applies to records relevant to reservations. - * + * * @return the reservationName value. */ public String reservationName() { @@ -837,7 +792,7 @@ public String reservationName() { /** * Get the productOrderId property: The identifier for the asset or Azure plan name that the subscription belongs * to. For example: Azure Plan. For reservations this is the Reservation Order ID. - * + * * @return the productOrderId value. */ public String productOrderId() { @@ -846,7 +801,7 @@ public String productOrderId() { /** * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. - * + * * @return the productOrderName value. */ public String productOrderName() { @@ -855,7 +810,7 @@ public String productOrderName() { /** * Get the isAzureCreditEligible property: Determines if the cost is eligible to be paid for using Azure credits. - * + * * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { @@ -866,7 +821,7 @@ public Boolean isAzureCreditEligible() { * Get the term property: Term (in months). Displays the term for the validity of the offer. For example. In case of * reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or * recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. - * + * * @return the term value. */ public String term() { @@ -876,7 +831,7 @@ public String term() { /** * Get the publisherName property: Name of the publisher of the service including Microsoft or Third Party * publishers. - * + * * @return the publisherName value. */ public String publisherName() { @@ -886,7 +841,7 @@ public String publisherName() { /** * Get the publisherType property: Type of publisher that identifies if the publisher is first party, third party * reseller or third party agency. - * + * * @return the publisherType value. */ public String publisherType() { @@ -896,7 +851,7 @@ public String publisherType() { /** * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation * fee, or a refund. - * + * * @return the chargeType value. */ public String chargeType() { @@ -907,7 +862,7 @@ public String chargeType() { * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is * used. - * + * * @return the frequency value. */ public String frequency() { @@ -916,7 +871,7 @@ public String frequency() { /** * Get the costInBillingCurrency property: ExtendedCost or blended cost before tax in billed currency. - * + * * @return the costInBillingCurrency value. */ public BigDecimal costInBillingCurrency() { @@ -926,7 +881,7 @@ public BigDecimal costInBillingCurrency() { /** * Get the costInPricingCurrency property: ExtendedCost or blended cost before tax in pricing currency to correlate * with prices. - * + * * @return the costInPricingCurrency value. */ public BigDecimal costInPricingCurrency() { @@ -935,7 +890,7 @@ public BigDecimal costInPricingCurrency() { /** * Get the exchangeRate property: Exchange rate used in conversion from pricing currency to billing currency. - * + * * @return the exchangeRate value. */ public String exchangeRate() { @@ -945,7 +900,7 @@ public String exchangeRate() { /** * Get the exchangeRateDate property: Date on which exchange rate used in conversion from pricing currency to * billing currency. - * + * * @return the exchangeRateDate value. */ public OffsetDateTime exchangeRateDate() { @@ -954,7 +909,7 @@ public OffsetDateTime exchangeRateDate() { /** * Get the invoiceId property: Invoice ID as on the invoice where the specific transaction appears. - * + * * @return the invoiceId value. */ public String invoiceId() { @@ -964,7 +919,7 @@ public String invoiceId() { /** * Get the previousInvoiceId property: Reference to an original invoice there is a refund (negative cost). This is * populated only when there is a refund. - * + * * @return the previousInvoiceId value. */ public String previousInvoiceId() { @@ -973,7 +928,7 @@ public String previousInvoiceId() { /** * Get the pricingCurrencyCode property: Pricing Billing Currency. - * + * * @return the pricingCurrencyCode value. */ public String pricingCurrencyCode() { @@ -983,7 +938,7 @@ public String pricingCurrencyCode() { /** * Get the productIdentifier property: Identifier for the product that has accrued charges by consumption or * purchase . This is the concatenated key of productId and SkuId in partner center. - * + * * @return the productIdentifier value. */ public String productIdentifier() { @@ -992,7 +947,7 @@ public String productIdentifier() { /** * Get the resourceLocationNormalized property: Resource Location Normalized. - * + * * @return the resourceLocationNormalized value. */ public String resourceLocationNormalized() { @@ -1002,7 +957,7 @@ public String resourceLocationNormalized() { /** * Get the servicePeriodStartDate property: Start date for the rating period when the service usage was rated for * charges. The prices for Azure services are determined for the rating period. - * + * * @return the servicePeriodStartDate value. */ public OffsetDateTime servicePeriodStartDate() { @@ -1012,7 +967,7 @@ public OffsetDateTime servicePeriodStartDate() { /** * Get the servicePeriodEndDate property: End date for the period when the service usage was rated for charges. The * prices for Azure services are determined based on the rating period. - * + * * @return the servicePeriodEndDate value. */ public OffsetDateTime servicePeriodEndDate() { @@ -1021,7 +976,7 @@ public OffsetDateTime servicePeriodEndDate() { /** * Get the customerTenantId property: Identifier of the customer's AAD tenant. - * + * * @return the customerTenantId value. */ public String customerTenantId() { @@ -1030,7 +985,7 @@ public String customerTenantId() { /** * Get the customerName property: Name of the customer's AAD tenant. - * + * * @return the customerName value. */ public String customerName() { @@ -1039,7 +994,7 @@ public String customerName() { /** * Get the partnerTenantId property: Identifier for the partner's AAD tenant. - * + * * @return the partnerTenantId value. */ public String partnerTenantId() { @@ -1048,7 +1003,7 @@ public String partnerTenantId() { /** * Get the partnerName property: Name of the partner' AAD tenant. - * + * * @return the partnerName value. */ public String partnerName() { @@ -1057,7 +1012,7 @@ public String partnerName() { /** * Get the resellerMpnId property: MPNId for the reseller associated with the subscription. - * + * * @return the resellerMpnId value. */ public String resellerMpnId() { @@ -1066,7 +1021,7 @@ public String resellerMpnId() { /** * Get the resellerName property: Reseller Name. - * + * * @return the resellerName value. */ public String resellerName() { @@ -1075,7 +1030,7 @@ public String resellerName() { /** * Get the publisherId property: Publisher Id. - * + * * @return the publisherId value. */ public String publisherId() { @@ -1084,7 +1039,7 @@ public String publisherId() { /** * Get the marketPrice property: Market Price that's charged for the usage. - * + * * @return the marketPrice value. */ public BigDecimal marketPrice() { @@ -1093,7 +1048,7 @@ public BigDecimal marketPrice() { /** * Get the exchangeRatePricingToBilling property: Exchange Rate from pricing currency to billing currency. - * + * * @return the exchangeRatePricingToBilling value. */ public BigDecimal exchangeRatePricingToBilling() { @@ -1102,7 +1057,7 @@ public BigDecimal exchangeRatePricingToBilling() { /** * Get the paygCostInBillingCurrency property: The amount of PayG cost before tax in billing currency. - * + * * @return the paygCostInBillingCurrency value. */ public BigDecimal paygCostInBillingCurrency() { @@ -1111,7 +1066,7 @@ public BigDecimal paygCostInBillingCurrency() { /** * Get the paygCostInUsd property: The amount of PayG cost before tax in US Dollar currency. - * + * * @return the paygCostInUsd value. */ public BigDecimal paygCostInUsd() { @@ -1121,7 +1076,7 @@ public BigDecimal paygCostInUsd() { /** * Get the partnerEarnedCreditRate property: Rate of discount applied if there is a partner earned credit (PEC) * based on partner admin link access. - * + * * @return the partnerEarnedCreditRate value. */ public BigDecimal partnerEarnedCreditRate() { @@ -1130,7 +1085,7 @@ public BigDecimal partnerEarnedCreditRate() { /** * Get the partnerEarnedCreditApplied property: Flag to indicate if partner earned credit has been applied or not. - * + * * @return the partnerEarnedCreditApplied value. */ public String partnerEarnedCreditApplied() { @@ -1139,7 +1094,7 @@ public String partnerEarnedCreditApplied() { /** * Get the payGPrice property: Retail price for the resource. - * + * * @return the payGPrice value. */ public BigDecimal payGPrice() { @@ -1148,7 +1103,7 @@ public BigDecimal payGPrice() { /** * Get the benefitId property: Unique identifier for the applicable benefit. - * + * * @return the benefitId value. */ public String benefitId() { @@ -1157,7 +1112,7 @@ public String benefitId() { /** * Get the benefitName property: Name of the applicable benefit. - * + * * @return the benefitName value. */ public String benefitName() { @@ -1167,7 +1122,7 @@ public String benefitName() { /** * Get the provider property: Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS * e.t.c. - * + * * @return the provider value. */ public String provider() { @@ -1176,7 +1131,7 @@ public String provider() { /** * Get the costAllocationRuleName property: Name for Cost Allocation Rule. - * + * * @return the costAllocationRuleName value. */ public String costAllocationRuleName() { @@ -1185,7 +1140,7 @@ public String costAllocationRuleName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationInner.java index fe76c6fdfa54..ad3d3f44e6f2 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,14 @@ 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. */ +/** + * A Consumption REST API operation. + */ @Fluent public final class OperationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationInner.class); - /* * Operation Id. */ @@ -33,9 +31,15 @@ public final class OperationInner { @JsonProperty(value = "display") private OperationDisplay display; + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + /** * Get the id property: Operation Id. - * + * * @return the id value. */ public String id() { @@ -44,7 +48,7 @@ public String id() { /** * Get the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @return the name value. */ public String name() { @@ -53,7 +57,7 @@ public String name() { /** * Get the display property: The object that represents the operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -62,7 +66,7 @@ public OperationDisplay display() { /** * Set the display property: The object that represents the operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -73,7 +77,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * 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/OperationStatusInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationStatusInner.java new file mode 100644 index 000000000000..043881ab92a9 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/OperationStatusInner.java @@ -0,0 +1,92 @@ +// 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 PricesheetDownloadProperties 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 PricesheetDownloadProperties 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 0e4aa629a411..646174987adf 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,16 @@ 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. */ +/** + * 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,9 +33,15 @@ 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. - * + * * @return the pricesheets value. */ public List pricesheets() { @@ -46,7 +50,7 @@ public List pricesheets() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -55,7 +59,7 @@ public String nextLink() { /** * Get the download property: Pricesheet download details. - * + * * @return the download value. */ public MeterDetails download() { @@ -64,7 +68,7 @@ public MeterDetails download() { /** * 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/PriceSheetResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PriceSheetResultInner.java index 7d19b3f74d32..8144dbcf1350 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,22 @@ 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 +/** + * An pricesheet resource. + */ +@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,9 +37,15 @@ 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. - * + * * @return the innerProperties value. */ private PriceSheetModel innerProperties() { @@ -51,7 +54,7 @@ private PriceSheetModel innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -60,7 +63,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -69,7 +72,7 @@ public Map tags() { /** * Get the pricesheets property: Price sheet. - * + * * @return the pricesheets value. */ public List pricesheets() { @@ -78,7 +81,7 @@ public List pricesheets() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -87,7 +90,7 @@ public String nextLink() { /** * Get the download property: Pricesheet download details. - * + * * @return the download value. */ public MeterDetails download() { @@ -96,7 +99,7 @@ public MeterDetails download() { /** * 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/PricesheetDownloadProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PricesheetDownloadProperties.java new file mode 100644 index 000000000000..faea82551a34 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/PricesheetDownloadProperties.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.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 PricesheetDownloadProperties { + /* + * 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 PricesheetDownloadProperties class. + */ + public PricesheetDownloadProperties() { + } + + /** + * 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/ReservationDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailInner.java index ba58947769d8..71910beea1f8 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,21 +4,19 @@ 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; import java.time.OffsetDateTime; import java.util.Map; -/** reservation detail resource. */ -@Fluent +/** + * reservation detail resource. + */ +@Immutable public final class ReservationDetailInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationDetailInner.class); - /* * The properties of the reservation detail. */ @@ -38,9 +36,15 @@ 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. - * + * * @return the innerProperties value. */ private ReservationDetailProperties innerProperties() { @@ -49,7 +53,7 @@ private ReservationDetailProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -58,7 +62,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -69,7 +73,7 @@ public Map tags() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -78,7 +82,7 @@ public String reservationOrderId() { /** * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * + * * @return the instanceFlexibilityRatio value. */ public String instanceFlexibilityRatio() { @@ -87,7 +91,7 @@ public String instanceFlexibilityRatio() { /** * Get the instanceFlexibilityGroup property: The instance Flexibility Group. - * + * * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { @@ -98,7 +102,7 @@ public String instanceFlexibilityGroup() { * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to * which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ public String reservationId() { @@ -108,7 +112,7 @@ public String reservationId() { /** * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ public String skuName() { @@ -118,7 +122,7 @@ public String skuName() { /** * Get the reservedHours property: This is the total hours reserved for the day. E.g. if reservation for 1 instance * was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ public BigDecimal reservedHours() { @@ -127,7 +131,7 @@ public BigDecimal reservedHours() { /** * Get the usageDate property: The date on which consumption occurred. - * + * * @return the usageDate value. */ public OffsetDateTime usageDate() { @@ -136,7 +140,7 @@ public OffsetDateTime usageDate() { /** * Get the usedHours property: This is the total hours used by the instance. - * + * * @return the usedHours value. */ public BigDecimal usedHours() { @@ -145,7 +149,7 @@ public BigDecimal usedHours() { /** * Get the instanceId property: This identifier is the name of the resource or the fully qualified Resource ID. - * + * * @return the instanceId value. */ public String instanceId() { @@ -155,7 +159,7 @@ public String instanceId() { /** * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { @@ -164,7 +168,7 @@ public BigDecimal totalReservedQuantity() { /** * Get the kind property: The reservation kind. - * + * * @return the kind value. */ public String kind() { @@ -173,7 +177,7 @@ public String kind() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationDetailProperties.java index 99fe617af2d0..a7aa52087f43 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,22 +5,17 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; -/** The properties of the reservation detail. */ +/** + * 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,19 @@ 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 +63,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,11 +80,17 @@ 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 * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -106,7 +99,7 @@ public String reservationOrderId() { /** * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * + * * @return the instanceFlexibilityRatio value. */ public String instanceFlexibilityRatio() { @@ -115,7 +108,7 @@ public String instanceFlexibilityRatio() { /** * Get the instanceFlexibilityGroup property: The instance Flexibility Group. - * + * * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { @@ -126,7 +119,7 @@ public String instanceFlexibilityGroup() { * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to * which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ public String reservationId() { @@ -136,7 +129,7 @@ public String reservationId() { /** * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ public String skuName() { @@ -146,7 +139,7 @@ public String skuName() { /** * Get the reservedHours property: This is the total hours reserved for the day. E.g. if reservation for 1 instance * was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ public BigDecimal reservedHours() { @@ -155,7 +148,7 @@ public BigDecimal reservedHours() { /** * Get the usageDate property: The date on which consumption occurred. - * + * * @return the usageDate value. */ public OffsetDateTime usageDate() { @@ -164,7 +157,7 @@ public OffsetDateTime usageDate() { /** * Get the usedHours property: This is the total hours used by the instance. - * + * * @return the usedHours value. */ public BigDecimal usedHours() { @@ -173,7 +166,7 @@ public BigDecimal usedHours() { /** * Get the instanceId property: This identifier is the name of the resource or the fully qualified Resource ID. - * + * * @return the instanceId value. */ public String instanceId() { @@ -183,7 +176,7 @@ public String instanceId() { /** * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { @@ -192,7 +185,7 @@ public BigDecimal totalReservedQuantity() { /** * Get the kind property: The reservation kind. - * + * * @return the kind value. */ public String kind() { @@ -201,7 +194,7 @@ public String kind() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsModelInner.java index 68e957a682f6..5d44c2705dd4 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,20 +6,18 @@ 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; -/** Reservation recommendation details. */ +/** + * Reservation recommendation details. + */ @Fluent public final class ReservationRecommendationDetailsModelInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationDetailsModelInner.class); - /* * Resource Location. */ @@ -51,9 +49,15 @@ 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. - * + * * @return the location value. */ public String location() { @@ -62,7 +66,7 @@ public String location() { /** * Set the location property: Resource Location. - * + * * @param location the location value to set. * @return the ReservationRecommendationDetailsModelInner object itself. */ @@ -73,7 +77,7 @@ public ReservationRecommendationDetailsModelInner withLocation(String location) /** * Get the sku property: Resource sku. - * + * * @return the sku value. */ public String sku() { @@ -82,7 +86,7 @@ public String sku() { /** * Set the sku property: Resource sku. - * + * * @param sku the sku value to set. * @return the ReservationRecommendationDetailsModelInner object itself. */ @@ -93,7 +97,7 @@ public ReservationRecommendationDetailsModelInner withSku(String sku) { /** * Get the innerProperties property: The properties of the reservation recommendation. - * + * * @return the innerProperties value. */ private ReservationRecommendationDetailsProperties innerProperties() { @@ -102,7 +106,7 @@ private ReservationRecommendationDetailsProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -111,7 +115,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -120,7 +124,7 @@ public Map tags() { /** * Get the currency property: An ISO 4217 currency code identifier for the costs and savings. - * + * * @return the currency value. */ public String currency() { @@ -129,7 +133,7 @@ public String currency() { /** * Get the resource property: Resource specific properties. - * + * * @return the resource value. */ public ReservationRecommendationDetailsResourceProperties resource() { @@ -138,7 +142,7 @@ public ReservationRecommendationDetailsResourceProperties resource() { /** * Get the resourceGroup property: Resource Group. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -147,7 +151,7 @@ public String resourceGroup() { /** * Get the savings property: Savings information for the recommendation. - * + * * @return the savings value. */ public ReservationRecommendationDetailsSavingsProperties savings() { @@ -156,7 +160,7 @@ public ReservationRecommendationDetailsSavingsProperties savings() { /** * Get the scope property: Scope of the reservation, ex: Single or Shared. - * + * * @return the scope value. */ public String scope() { @@ -165,7 +169,7 @@ public String scope() { /** * Get the usage property: Historical usage details used to calculate the estimated savings. - * + * * @return the usage value. */ public ReservationRecommendationDetailsUsageProperties usage() { @@ -174,7 +178,7 @@ public ReservationRecommendationDetailsUsageProperties usage() { /** * 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/ReservationRecommendationDetailsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationDetailsProperties.java index adeb2dae589c..c76daeb32d28 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,20 +5,18 @@ 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. */ +/** + * 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 + * An ISO 4217 currency code identifier for the costs and savings */ @JsonProperty(value = "currency", access = JsonProperty.Access.WRITE_ONLY) private String currency; @@ -53,9 +51,15 @@ 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. - * + * * @return the currency value. */ public String currency() { @@ -64,7 +68,7 @@ public String currency() { /** * Get the resource property: Resource specific properties. - * + * * @return the resource value. */ public ReservationRecommendationDetailsResourceProperties resource() { @@ -73,7 +77,7 @@ public ReservationRecommendationDetailsResourceProperties resource() { /** * Get the resourceGroup property: Resource Group. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -82,7 +86,7 @@ public String resourceGroup() { /** * Get the savings property: Savings information for the recommendation. - * + * * @return the savings value. */ public ReservationRecommendationDetailsSavingsProperties savings() { @@ -91,7 +95,7 @@ public ReservationRecommendationDetailsSavingsProperties savings() { /** * Get the scope property: Scope of the reservation, ex: Single or Shared. - * + * * @return the scope value. */ public String scope() { @@ -100,7 +104,7 @@ public String scope() { /** * Get the usage property: Historical usage details used to calculate the estimated savings. - * + * * @return the usage value. */ public ReservationRecommendationDetailsUsageProperties usage() { @@ -109,7 +113,7 @@ public ReservationRecommendationDetailsUsageProperties usage() { /** * 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/ReservationRecommendationInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationRecommendationInner.java index 45566e5e4012..cef12243cad1 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,31 +6,37 @@ 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.azure.resourcemanager.consumption.models.ReservationRecommendationKind; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** A reservation recommendation resource. */ +/** + * A reservation recommendation resource. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "kind", - defaultImpl = ReservationRecommendationInner.class) + defaultImpl = ReservationRecommendationInner.class, + visible = true) @JsonTypeName("ReservationRecommendation") @JsonSubTypes({ @JsonSubTypes.Type(name = "legacy", value = LegacyReservationRecommendation.class), - @JsonSubTypes.Type(name = "modern", value = ModernReservationRecommendation.class) -}) + @JsonSubTypes.Type(name = "modern", value = ModernReservationRecommendation.class) }) @Immutable public class ReservationRecommendationInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationRecommendationInner.class); + /* + * Specifies the kind of reservation recommendation. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ReservationRecommendationKind kind; /* * The etag for the resource. @@ -57,9 +63,25 @@ public class ReservationRecommendationInner extends ProxyResource { @JsonProperty(value = "sku", access = JsonProperty.Access.WRITE_ONLY) private String sku; + /** + * Creates an instance of ReservationRecommendationInner class. + */ + public ReservationRecommendationInner() { + this.kind = ReservationRecommendationKind.fromString("ReservationRecommendation"); + } + + /** + * Get the kind property: Specifies the kind of reservation recommendation. + * + * @return the kind value. + */ + public ReservationRecommendationKind kind() { + return this.kind; + } + /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -68,7 +90,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -77,7 +99,7 @@ public Map tags() { /** * Get the location property: Resource location. - * + * * @return the location value. */ public String location() { @@ -86,7 +108,7 @@ public String location() { /** * Get the sku property: Resource sku. - * + * * @return the sku value. */ public String sku() { @@ -95,7 +117,7 @@ public String sku() { /** * 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/ReservationSummaryInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryInner.java index 7b913e6e0ac3..be026475b05e 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,21 +4,19 @@ 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; import java.time.OffsetDateTime; import java.util.Map; -/** reservation summary resource. */ -@Fluent +/** + * reservation summary resource. + */ +@Immutable public final class ReservationSummaryInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ReservationSummaryInner.class); - /* * The properties of the reservation summary. */ @@ -38,9 +36,15 @@ 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. - * + * * @return the innerProperties value. */ private ReservationSummaryProperties innerProperties() { @@ -49,7 +53,7 @@ private ReservationSummaryProperties innerProperties() { /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -58,7 +62,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -69,7 +73,7 @@ public Map tags() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -80,7 +84,7 @@ public String reservationOrderId() { * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to * which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ public String reservationId() { @@ -90,7 +94,7 @@ public String reservationId() { /** * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ public String skuName() { @@ -100,7 +104,7 @@ public String skuName() { /** * Get the reservedHours property: This is the total hours reserved. E.g. if reservation for 1 instance was made on * 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ public BigDecimal reservedHours() { @@ -110,7 +114,7 @@ public BigDecimal reservedHours() { /** * Get the usageDate property: Data corresponding to the utilization record. If the grain of data is monthly, it * will be first day of month. - * + * * @return the usageDate value. */ public OffsetDateTime usageDate() { @@ -119,7 +123,7 @@ public OffsetDateTime usageDate() { /** * Get the usedHours property: Total used hours by the reservation. - * + * * @return the usedHours value. */ public BigDecimal usedHours() { @@ -130,7 +134,7 @@ public BigDecimal usedHours() { * Get the minUtilizationPercentage property: This is the minimum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this * field will return 10% for that day. - * + * * @return the minUtilizationPercentage value. */ public BigDecimal minUtilizationPercentage() { @@ -140,7 +144,7 @@ public BigDecimal minUtilizationPercentage() { /** * Get the avgUtilizationPercentage property: This is average utilization for the entire time range. (day or month * depending on the grain). - * + * * @return the avgUtilizationPercentage value. */ public BigDecimal avgUtilizationPercentage() { @@ -151,7 +155,7 @@ public BigDecimal avgUtilizationPercentage() { * Get the maxUtilizationPercentage property: This is the maximum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this * field will return 100% for that day. - * + * * @return the maxUtilizationPercentage value. */ public BigDecimal maxUtilizationPercentage() { @@ -160,7 +164,7 @@ public BigDecimal maxUtilizationPercentage() { /** * Get the kind property: The reservation kind. - * + * * @return the kind value. */ public String kind() { @@ -169,7 +173,7 @@ public String kind() { /** * Get the purchasedQuantity property: This is the purchased quantity for the reservationId. - * + * * @return the purchasedQuantity value. */ public BigDecimal purchasedQuantity() { @@ -178,7 +182,7 @@ public BigDecimal purchasedQuantity() { /** * Get the remainingQuantity property: This is the remaining quantity for the reservationId. - * + * * @return the remainingQuantity value. */ public BigDecimal remainingQuantity() { @@ -188,7 +192,7 @@ public BigDecimal remainingQuantity() { /** * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { @@ -197,7 +201,7 @@ public BigDecimal totalReservedQuantity() { /** * Get the usedQuantity property: This is the used quantity for the reservationId. - * + * * @return the usedQuantity value. */ public BigDecimal usedQuantity() { @@ -206,7 +210,7 @@ public BigDecimal usedQuantity() { /** * Get the utilizedPercentage property: This is the utilized percentage for the reservation Id. - * + * * @return the utilizedPercentage value. */ public BigDecimal utilizedPercentage() { @@ -215,7 +219,7 @@ public BigDecimal utilizedPercentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationSummaryProperties.java index 2bd838de647e..d10fa502577d 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,53 +5,41 @@ package com.azure.resourcemanager.consumption.fluent.models; import com.azure.core.annotation.Immutable; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.math.BigDecimal; import java.time.OffsetDateTime; -/** The properties of the reservation summary. */ +/** + * 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 +51,19 @@ 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 +87,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,11 +104,17 @@ 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 * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -137,7 +125,7 @@ public String reservationOrderId() { * Get the reservationId property: The reservation ID is the identifier of a reservation within a reservation order. * Each reservation is the grouping for applying the benefit scope and also specifies the number of instances to * which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ public String reservationId() { @@ -147,7 +135,7 @@ public String reservationId() { /** * Get the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ public String skuName() { @@ -157,7 +145,7 @@ public String skuName() { /** * Get the reservedHours property: This is the total hours reserved. E.g. if reservation for 1 instance was made on * 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ public BigDecimal reservedHours() { @@ -167,7 +155,7 @@ public BigDecimal reservedHours() { /** * Get the usageDate property: Data corresponding to the utilization record. If the grain of data is monthly, it * will be first day of month. - * + * * @return the usageDate value. */ public OffsetDateTime usageDate() { @@ -176,7 +164,7 @@ public OffsetDateTime usageDate() { /** * Get the usedHours property: Total used hours by the reservation. - * + * * @return the usedHours value. */ public BigDecimal usedHours() { @@ -187,7 +175,7 @@ public BigDecimal usedHours() { * Get the minUtilizationPercentage property: This is the minimum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this * field will return 10% for that day. - * + * * @return the minUtilizationPercentage value. */ public BigDecimal minUtilizationPercentage() { @@ -197,7 +185,7 @@ public BigDecimal minUtilizationPercentage() { /** * Get the avgUtilizationPercentage property: This is average utilization for the entire time range. (day or month * depending on the grain). - * + * * @return the avgUtilizationPercentage value. */ public BigDecimal avgUtilizationPercentage() { @@ -208,7 +196,7 @@ public BigDecimal avgUtilizationPercentage() { * Get the maxUtilizationPercentage property: This is the maximum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this * field will return 100% for that day. - * + * * @return the maxUtilizationPercentage value. */ public BigDecimal maxUtilizationPercentage() { @@ -217,7 +205,7 @@ public BigDecimal maxUtilizationPercentage() { /** * Get the kind property: The reservation kind. - * + * * @return the kind value. */ public String kind() { @@ -226,7 +214,7 @@ public String kind() { /** * Get the purchasedQuantity property: This is the purchased quantity for the reservationId. - * + * * @return the purchasedQuantity value. */ public BigDecimal purchasedQuantity() { @@ -235,7 +223,7 @@ public BigDecimal purchasedQuantity() { /** * Get the remainingQuantity property: This is the remaining quantity for the reservationId. - * + * * @return the remainingQuantity value. */ public BigDecimal remainingQuantity() { @@ -245,7 +233,7 @@ public BigDecimal remainingQuantity() { /** * Get the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ public BigDecimal totalReservedQuantity() { @@ -254,7 +242,7 @@ public BigDecimal totalReservedQuantity() { /** * Get the usedQuantity property: This is the used quantity for the reservationId. - * + * * @return the usedQuantity value. */ public BigDecimal usedQuantity() { @@ -263,7 +251,7 @@ public BigDecimal usedQuantity() { /** * Get the utilizedPercentage property: This is the utilized percentage for the reservation Id. - * + * * @return the utilizedPercentage value. */ public BigDecimal utilizedPercentage() { @@ -272,7 +260,7 @@ public BigDecimal utilizedPercentage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/ReservationTransactionInner.java index f09a430c58bf..780d1d72d876 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,29 +4,33 @@ 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 +/** + * Reservation transaction resource. + */ +@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. - * + * * @return the innerProperties value. */ private LegacyReservationTransactionProperties innerProperties() { @@ -35,7 +39,7 @@ private LegacyReservationTransactionProperties innerProperties() { /** * Get the eventDate property: The date of the transaction. - * + * * @return the eventDate value. */ public OffsetDateTime eventDate() { @@ -46,7 +50,7 @@ public OffsetDateTime eventDate() { * Get the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ public String reservationOrderId() { @@ -55,7 +59,7 @@ public String reservationOrderId() { /** * Get the description property: The description of the transaction. - * + * * @return the description value. */ public String description() { @@ -63,8 +67,8 @@ 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. */ public String eventType() { @@ -73,7 +77,7 @@ public String eventType() { /** * Get the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -82,7 +86,7 @@ public BigDecimal quantity() { /** * Get the amount property: The charge of the transaction. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -91,7 +95,7 @@ public BigDecimal amount() { /** * Get the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ public String currency() { @@ -100,7 +104,7 @@ public String currency() { /** * Get the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ public String reservationOrderName() { @@ -109,7 +113,7 @@ public String reservationOrderName() { /** * Get the purchasingEnrollment property: The purchasing enrollment. - * + * * @return the purchasingEnrollment value. */ public String purchasingEnrollment() { @@ -118,7 +122,7 @@ public String purchasingEnrollment() { /** * Get the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ public UUID purchasingSubscriptionGuid() { @@ -127,7 +131,7 @@ public UUID purchasingSubscriptionGuid() { /** * Get the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ public String purchasingSubscriptionName() { @@ -137,7 +141,7 @@ public String purchasingSubscriptionName() { /** * Get the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ public String armSkuName() { @@ -146,7 +150,7 @@ public String armSkuName() { /** * Get the term property: This is the term of the transaction. - * + * * @return the term value. */ public String term() { @@ -155,7 +159,7 @@ public String term() { /** * Get the region property: The region of the transaction. - * + * * @return the region value. */ public String region() { @@ -164,7 +168,7 @@ public String region() { /** * Get the accountName property: The name of the account that makes the transaction. - * + * * @return the accountName value. */ public String accountName() { @@ -173,7 +177,7 @@ public String accountName() { /** * Get the accountOwnerEmail property: The email of the account owner that makes the transaction. - * + * * @return the accountOwnerEmail value. */ public String accountOwnerEmail() { @@ -182,7 +186,7 @@ public String accountOwnerEmail() { /** * Get the departmentName property: The department name. - * + * * @return the departmentName value. */ public String departmentName() { @@ -192,7 +196,7 @@ public String departmentName() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -201,7 +205,7 @@ public String costCenter() { /** * Get the currentEnrollment property: The current enrollment. - * + * * @return the currentEnrollment value. */ public String currentEnrollment() { @@ -210,7 +214,7 @@ public String currentEnrollment() { /** * Get the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ public String billingFrequency() { @@ -219,7 +223,7 @@ public String billingFrequency() { /** * Get the billingMonth property: The billing month(yyyyMMdd), on which the event initiated. - * + * * @return the billingMonth value. */ public Integer billingMonth() { @@ -228,7 +232,7 @@ public Integer billingMonth() { /** * Get the monetaryCommitment property: The monetary commitment amount at the enrollment scope. - * + * * @return the monetaryCommitment value. */ public BigDecimal monetaryCommitment() { @@ -237,7 +241,7 @@ public BigDecimal monetaryCommitment() { /** * Get the overage property: The overage amount at the enrollment scope. - * + * * @return the overage value. */ public BigDecimal overage() { @@ -246,7 +250,7 @@ public BigDecimal overage() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagProperties.java index c38afadca36c..a97f434ad83b 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,15 @@ 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. */ +/** + * The properties of the tag. + */ @Fluent public final class TagProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(TagProperties.class); - /* * A list of Tag. */ @@ -34,9 +32,15 @@ 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. - * + * * @return the tags value. */ public List tags() { @@ -45,7 +49,7 @@ public List tags() { /** * Set the tags property: A list of Tag. - * + * * @param tags the tags value to set. * @return the TagProperties object itself. */ @@ -56,7 +60,7 @@ public TagProperties withTags(List tags) { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -65,7 +69,7 @@ public String nextLink() { /** * Get the previousLink property: The link (url) to the previous page of results. - * + * * @return the previousLink value. */ public String previousLink() { @@ -74,7 +78,7 @@ public String previousLink() { /** * 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/TagsResultInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/TagsResultInner.java index 2cd3f869d8e8..ee139c286dd2 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,15 @@ 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. */ +/** + * 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,16 +22,20 @@ 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. - * + * * @return the innerProperties value. */ private TagProperties innerProperties() { @@ -43,7 +45,7 @@ private TagProperties innerProperties() { /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ public String etag() { @@ -53,7 +55,7 @@ public String etag() { /** * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @param etag the etag value to set. * @return the TagsResultInner object itself. */ @@ -64,7 +66,7 @@ public TagsResultInner withEtag(String etag) { /** * Get the tags property: A list of Tag. - * + * * @return the tags value. */ public List tags() { @@ -73,7 +75,7 @@ public List tags() { /** * Set the tags property: A list of Tag. - * + * * @param tags the tags value to set. * @return the TagsResultInner object itself. */ @@ -87,7 +89,7 @@ public TagsResultInner withTags(List tags) { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -96,7 +98,7 @@ public String nextLink() { /** * Get the previousLink property: The link (url) to the previous page of results. - * + * * @return the previousLink value. */ public String previousLink() { @@ -105,7 +107,7 @@ public String previousLink() { /** * 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/UsageDetailInner.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/UsageDetailInner.java index 97647be02c10..24aad729a83d 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,31 +6,33 @@ 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.azure.resourcemanager.consumption.models.UsageDetailsKind; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.Map; -/** An usage detail resource. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = UsageDetailInner.class) +/** + * An usage detail resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = UsageDetailInner.class, visible = true) @JsonTypeName("UsageDetail") @JsonSubTypes({ @JsonSubTypes.Type(name = "legacy", value = LegacyUsageDetail.class), - @JsonSubTypes.Type(name = "modern", value = ModernUsageDetail.class) -}) + @JsonSubTypes.Type(name = "modern", value = ModernUsageDetail.class) }) @Immutable public class UsageDetailInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsageDetailInner.class); + /* + * Specifies the kind of usage details. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private UsageDetailsKind kind; /* * The etag for the resource. @@ -45,9 +47,25 @@ 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() { + this.kind = UsageDetailsKind.fromString("UsageDetail"); + } + + /** + * Get the kind property: Specifies the kind of usage details. + * + * @return the kind value. + */ + public UsageDetailsKind kind() { + return this.kind; + } + /** * Get the etag property: The etag for the resource. - * + * * @return the etag value. */ public String etag() { @@ -56,7 +74,7 @@ public String etag() { /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -65,7 +83,7 @@ public Map tags() { /** * 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/package-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/package-info.java index 7598912d3a16..82de9c902780 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/package-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for ConsumptionManagementClient. Consumption management client provides - * access to consumption resources for Azure Enterprise Subscriptions. + * Package containing the inner data models for ConsumptionManagementClient. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.consumption.fluent.models; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/package-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/package-info.java index 9cd646224d1d..599c20c7e941 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/package-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for ConsumptionManagementClient. Consumption management client provides access - * to consumption resources for Azure Enterprise Subscriptions. + * Package containing the service clients for ConsumptionManagementClient. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.consumption.fluent; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/AggregatedCostsClientImpl.java index c241892a5f74..e75f6ab389bd 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,29 +21,32 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final AggregatedCostsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of AggregatedCostsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AggregatedCostsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(AggregatedCostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(AggregatedCostsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -53,56 +56,45 @@ public final class AggregatedCostsClientImpl implements AggregatedCostsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface AggregatedCostsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption" - + "/aggregatedcost") - @ExpectedResponses({200}) + public interface AggregatedCostsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Consumption/aggregatedcost") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByManagementGroup( - @HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + @HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, + @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing" - + "/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/aggregatedCost") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getForBillingPeriodByManagementGroup( - @HostParam("$host") String endpoint, - @PathParam("managementGroupId") String managementGroupId, - @PathParam("billingPeriodName") String billingPeriodName, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @HostParam("$host") String endpoint, @PathParam("managementGroupId") String managementGroupId, + @PathParam("billingPeriodName") String billingPeriodName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, 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 (:). + * 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. + * @return a management group aggregated cost resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByManagementGroupWithResponseAsync( - String managementGroupId, String filter) { + private Mono> + getByManagementGroupWithResponseAsync(String managementGroupId, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (managementGroupId == null) { return Mono @@ -110,40 +102,31 @@ private Mono> getByManagement } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByManagementGroup( - this.client.getEndpoint(), - managementGroupId, - this.client.getApiVersion(), - filter, - accept, - context)) + .withContext(context -> service.getByManagementGroup(this.client.getEndpoint(), managementGroupId, + this.client.getApiVersion(), filter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 (:). + * 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} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByManagementGroupWithResponseAsync( - String managementGroupId, String filter, Context context) { + private Mono> + getByManagementGroupWithResponseAsync(String managementGroupId, String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (managementGroupId == null) { return Mono @@ -151,112 +134,77 @@ private Mono> getByManagement } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByManagementGroup( - this.client.getEndpoint(), managementGroupId, this.client.getApiVersion(), filter, accept, 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 (:). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws 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(); - } - }); + return service.getByManagementGroup(this.client.getEndpoint(), managementGroupId, this.client.getApiVersion(), + filter, accept, context); } /** * 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(); } /** * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> getForBillingPeriodByManagementGroupWithResponseAsync(String managementGroupId, String billingPeriodName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (managementGroupId == null) { return Mono @@ -268,39 +216,30 @@ public Response getByManagementGroupWi } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getForBillingPeriodByManagementGroup( - this.client.getEndpoint(), - managementGroupId, - billingPeriodName, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.getForBillingPeriodByManagementGroup(this.client.getEndpoint(), + managementGroupId, billingPeriodName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 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> - getForBillingPeriodByManagementGroupWithResponseAsync( - String managementGroupId, String billingPeriodName, Context context) { + getForBillingPeriodByManagementGroupWithResponseAsync(String managementGroupId, String billingPeriodName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (managementGroupId == null) { return Mono @@ -312,71 +251,59 @@ public Response getByManagementGroupWi } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getForBillingPeriodByManagementGroup( - this.client.getEndpoint(), - managementGroupId, - billingPeriodName, - this.client.getApiVersion(), - accept, - context); + return service.getForBillingPeriodByManagementGroup(this.client.getEndpoint(), managementGroupId, + billingPeriodName, this.client.getApiVersion(), accept, 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) { + 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())); } /** * 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 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(); } /** * 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 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 946543806553..1171488586a8 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,68 +12,59 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public AggregatedCostsImpl( - AggregatedCostsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public AggregatedCostsImpl(AggregatedCostsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId) { - ManagementGroupAggregatedCostResultInner inner = this.serviceClient().getByManagementGroup(managementGroupId); + public Response getByManagementGroupWithResponse(String managementGroupId, + String filter, Context context) { + Response inner + = this.serviceClient().getByManagementGroupWithResponse(managementGroupId, filter, context); if (inner != null) { - return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagementGroupAggregatedCostResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByManagementGroupWithResponse( - String managementGroupId, String filter, Context context) { - Response inner = - this.serviceClient().getByManagementGroupWithResponse(managementGroupId, filter, context); + public ManagementGroupAggregatedCostResult getByManagementGroup(String managementGroupId) { + ManagementGroupAggregatedCostResultInner inner = this.serviceClient().getByManagementGroup(managementGroupId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ManagementGroupAggregatedCostResultImpl(inner.getValue(), this.manager())); + return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); } else { return null; } } - public ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup( - String managementGroupId, String billingPeriodName) { - ManagementGroupAggregatedCostResultInner inner = - this.serviceClient().getForBillingPeriodByManagementGroup(managementGroupId, billingPeriodName); + public Response getForBillingPeriodByManagementGroupWithResponse( + String managementGroupId, String billingPeriodName, Context context) { + Response inner = this.serviceClient() + .getForBillingPeriodByManagementGroupWithResponse(managementGroupId, billingPeriodName, context); if (inner != null) { - return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ManagementGroupAggregatedCostResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getForBillingPeriodByManagementGroupWithResponse( - String managementGroupId, String billingPeriodName, Context context) { - Response inner = - this - .serviceClient() - .getForBillingPeriodByManagementGroupWithResponse(managementGroupId, billingPeriodName, context); + public ManagementGroupAggregatedCostResult getForBillingPeriodByManagementGroup(String managementGroupId, + String billingPeriodName) { + ManagementGroupAggregatedCostResultInner inner + = this.serviceClient().getForBillingPeriodByManagementGroup(managementGroupId, billingPeriodName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ManagementGroupAggregatedCostResultImpl(inner.getValue(), this.manager())); + return new ManagementGroupAggregatedCostResultImpl(inner, this.manager()); } else { return null; } 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 2f73babf5e6d..5dfef26a7afc 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 142543f3d1a7..4c87e4282655 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,24 +21,27 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final BalancesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of BalancesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BalancesClientImpl(ConsumptionManagementClientImpl client) { @@ -52,50 +55,41 @@ public final class BalancesClientImpl implements BalancesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface BalancesService { - @Headers({"Content-Type: application/json"}) + public interface BalancesService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/balances") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountId") String billingAccountId, - @HeaderParam("Accept") String accept, - Context context); + Mono> getByBillingAccount(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}" - + "/providers/Microsoft.Consumption/balances") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/balances") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getForBillingPeriodByBillingAccount( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingPeriodName") String billingPeriodName, - @HeaderParam("Accept") String accept, + Mono> getForBillingPeriodByBillingAccount(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingPeriodName") String billingPeriodName, @HeaderParam("Accept") String accept, 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -103,33 +97,29 @@ private Mono> getByBillingAccountWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByBillingAccount( - this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, accept, context)) + .withContext(context -> service.getByBillingAccount(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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 ManagementException 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, Context context) { + private Mono> getByBillingAccountWithResponseAsync(String billingAccountId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -137,84 +127,74 @@ private Mono> getByBillingAccountWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByBillingAccount( - this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, accept, context); + return service.getByBillingAccount(this.client.getEndpoint(), this.client.getApiVersion(), billingAccountId, + accept, 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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())); } /** * 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 ManagementException 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(); } /** * 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 ManagementException 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(); } /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only * for May 1, 2014 or later. - * + * * @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 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( - String billingAccountId, String billingPeriodName) { + private Mono> getForBillingPeriodByBillingAccountWithResponseAsync(String billingAccountId, + String billingPeriodName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -226,39 +206,30 @@ private Mono> getForBillingPeriodByBillingAccountWithResp } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getForBillingPeriodByBillingAccount( - this.client.getEndpoint(), - this.client.getApiVersion(), - billingAccountId, - billingPeriodName, - accept, - context)) + .withContext(context -> service.getForBillingPeriodByBillingAccount(this.client.getEndpoint(), + this.client.getApiVersion(), billingAccountId, billingPeriodName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only * for May 1, 2014 or later. - * + * * @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} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getForBillingPeriodByBillingAccountWithResponseAsync( - String billingAccountId, String billingPeriodName, Context context) { + private Mono> getForBillingPeriodByBillingAccountWithResponseAsync(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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -270,73 +241,61 @@ private Mono> getForBillingPeriodByBillingAccountWithResp } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getForBillingPeriodByBillingAccount( - this.client.getEndpoint(), - this.client.getApiVersion(), - billingAccountId, - billingPeriodName, - accept, - context); + return service.getForBillingPeriodByBillingAccount(this.client.getEndpoint(), this.client.getApiVersion(), + billingAccountId, billingPeriodName, accept, context); } /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only * for May 1, 2014 or later. - * + * * @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 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) { + 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())); } /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only * for May 1, 2014 or later. - * + * * @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(); } /** * Gets the balances for a scope by billing period and billingAccountId. Balances are available via this API only * for May 1, 2014 or later. - * + * * @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 e1652cddc7ca..d9f8e0c14867 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,65 +12,56 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public BalancesImpl( - BalancesClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public BalancesImpl(BalancesClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public Balance getByBillingAccount(String billingAccountId) { - BalanceInner inner = this.serviceClient().getByBillingAccount(billingAccountId); + public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { + Response inner = this.serviceClient().getByBillingAccountWithResponse(billingAccountId, context); if (inner != null) { - return new BalanceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BalanceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getByBillingAccountWithResponse(String billingAccountId, Context context) { - Response inner = this.serviceClient().getByBillingAccountWithResponse(billingAccountId, context); + public Balance getByBillingAccount(String billingAccountId) { + BalanceInner inner = this.serviceClient().getByBillingAccount(billingAccountId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BalanceImpl(inner.getValue(), this.manager())); + return new BalanceImpl(inner, this.manager()); } else { return null; } } - public Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { - BalanceInner inner = - this.serviceClient().getForBillingPeriodByBillingAccount(billingAccountId, billingPeriodName); + public Response getForBillingPeriodByBillingAccountWithResponse(String billingAccountId, + String billingPeriodName, Context context) { + Response inner = this.serviceClient() + .getForBillingPeriodByBillingAccountWithResponse(billingAccountId, billingPeriodName, context); if (inner != null) { - return new BalanceImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BalanceImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getForBillingPeriodByBillingAccountWithResponse( - String billingAccountId, String billingPeriodName, Context context) { - Response inner = - this - .serviceClient() - .getForBillingPeriodByBillingAccountWithResponse(billingAccountId, billingPeriodName, context); + public Balance getForBillingPeriodByBillingAccount(String billingAccountId, String billingPeriodName) { + BalanceInner inner + = this.serviceClient().getForBillingPeriodByBillingAccount(billingAccountId, billingPeriodName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BalanceImpl(inner.getValue(), this.manager())); + return new BalanceImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java index e75cd7f54bd9..40db430b39de 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetImpl.java @@ -94,22 +94,18 @@ public BudgetImpl withExistingScope(String scope) { } public Budget create() { - this.innerObject = - serviceManager - .serviceClient() - .getBudgets() - .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) + .getValue(); return this; } public Budget create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBudgets() - .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) + .getValue(); return this; } @@ -124,47 +120,39 @@ public BudgetImpl update() { } public Budget apply() { - this.innerObject = - serviceManager - .serviceClient() - .getBudgets() - .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), Context.NONE) + .getValue(); return this; } public Budget apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getBudgets() - .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) - .getValue(); + this.innerObject = serviceManager.serviceClient() + .getBudgets() + .createOrUpdateWithResponse(scope, budgetName, this.innerModel(), context) + .getValue(); return this; } BudgetImpl(BudgetInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.scope = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); - this.budgetName = - Utils - .getValueFromIdByParameterName( - innerObject.id(), "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); + this.scope = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); + this.budgetName = ResourceManagerUtils.getValueFromIdByParameterName(innerObject.id(), + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); } public Budget refresh() { - this.innerObject = - serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, Context.NONE).getValue(); + this.innerObject + = serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, Context.NONE).getValue(); return this; } public Budget refresh(Context context) { - this.innerObject = - serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, context).getValue(); + this.innerObject + = serviceManager.serviceClient().getBudgets().getWithResponse(scope, budgetName, context).getValue(); return this; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsClientImpl.java index d1175bb8bab1..e49f942bee87 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,25 +28,28 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in BudgetsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final BudgetsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of BudgetsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ BudgetsClientImpl(ConsumptionManagementClientImpl client) { @@ -60,93 +63,72 @@ public final class BudgetsClientImpl implements BudgetsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface BudgetsService { - @Headers({"Content-Type: application/json"}) + public interface BudgetsService { + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Consumption/budgets") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> list(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @PathParam("budgetName") String budgetName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> get(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @PathParam("budgetName") String budgetName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Put("/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}") - @ExpectedResponses({200, 201}) + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @PathParam("budgetName") String budgetName, - @BodyParam("application/json") BudgetInner parameters, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @PathParam("budgetName") String budgetName, @BodyParam("application/json") BudgetInner parameters, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Delete("/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @PathParam("budgetName") String budgetName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> delete(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @PathParam("budgetName") String budgetName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -155,84 +137,65 @@ private Mono> listSinglePageAsync(String scope) { return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { @@ -241,50 +204,48 @@ private PagedFlux listAsync(String scope) { /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { @@ -293,24 +254,23 @@ public PagedIterable list(String scope) { /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { @@ -319,32 +279,30 @@ public PagedIterable list(String scope, Context context) { /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -354,43 +312,38 @@ private Mono> getWithResponseAsync(String scope, String bu } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), scope, this.client.getApiVersion(), + budgetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -405,123 +358,109 @@ private Mono> getWithResponseAsync(String scope, String bu /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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())); } /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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(); } /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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(); } /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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( - String scope, String budgetName, BudgetInner parameters) { + private Mono> createOrUpdateWithResponseAsync(String scope, String budgetName, + BudgetInner parameters) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -536,17 +475,8 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .createOrUpdate( - this.client.getEndpoint(), - scope, - this.client.getApiVersion(), - budgetName, - parameters, - accept, - context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), scope, + this.client.getApiVersion(), budgetName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -554,35 +484,32 @@ private Mono> createOrUpdateWithResponseAsync( * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String scope, String budgetName, BudgetInner parameters, Context context) { + private Mono> createOrUpdateWithResponseAsync(String scope, String budgetName, + BudgetInner parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -597,136 +524,122 @@ private Mono> createOrUpdateWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .createOrUpdate( - this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, + parameters, accept, context); } /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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())); } /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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(); } /** * The operation to create or update a budget. You can optionally provide an eTag if desired as a form of * concurrency control. To obtain the latest eTag for a given budget, perform a get operation prior to your put * operation. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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(); } /** * The operation to delete a budget. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -736,43 +649,37 @@ private Mono> deleteWithResponseAsync(String scope, String budget } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .delete( - this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), scope, this.client.getApiVersion(), + budgetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to delete a budget. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -782,96 +689,95 @@ private Mono> deleteWithResponseAsync(String scope, String budget } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .delete(this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, accept, context); + return service.delete(this.client.getEndpoint(), scope, this.client.getApiVersion(), budgetName, accept, + context); } /** * The operation to delete a budget. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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()); } /** * The operation to delete a budget. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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(); } /** * The operation to delete a budget. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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) { @@ -879,35 +785,27 @@ private Mono> listNextSinglePageAsync(String nextLink 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -915,23 +813,13 @@ private Mono> listNextSinglePageAsync(String nextLink 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/BudgetsImpl.java index 533b9307c644..f678d67451ff 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,155 +13,119 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public BudgetsImpl( - BudgetsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public BudgetsImpl(BudgetsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); } public PagedIterable list(String scope, Context context) { PagedIterable inner = this.serviceClient().list(scope, context); - return Utils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new BudgetImpl(inner1, this.manager())); } - public Budget get(String scope, String budgetName) { - BudgetInner inner = this.serviceClient().get(scope, budgetName); + public Response getWithResponse(String scope, String budgetName, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, budgetName, context); if (inner != null) { - return new BudgetImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BudgetImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse(String scope, String budgetName, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, budgetName, context); + public Budget get(String scope, String budgetName) { + BudgetInner inner = this.serviceClient().get(scope, budgetName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new BudgetImpl(inner.getValue(), this.manager())); + return new BudgetImpl(inner, this.manager()); } else { return null; } } - public void deleteByResourceGroup(String scope, String budgetName) { - this.serviceClient().delete(scope, budgetName); + public Response deleteByResourceGroupWithResponse(String scope, String budgetName, Context context) { + return this.serviceClient().deleteWithResponse(scope, budgetName, context); } - public Response deleteWithResponse(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"); + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String budgetName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); } return this.getWithResponse(scope, budgetName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String budgetName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); } return this.getWithResponse(scope, budgetName, context); } public void deleteById(String id) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String budgetName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + 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) { - String scope = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); + String scope = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "scope"); if (scope == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); } - String budgetName = - Utils - .getValueFromIdByParameterName( - id, "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); + String budgetName = ResourceManagerUtils.getValueFromIdByParameterName(id, + "/{scope}/providers/Microsoft.Consumption/budgets/{budgetName}", "budgetName"); if (budgetName == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'budgets'.", id))); + 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 7a1bc33418ff..3cf1f22e7e23 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,24 +21,27 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ChargesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ChargesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ChargesClientImpl(ConsumptionManagementClientImpl client) { @@ -52,214 +55,136 @@ public final class ChargesClientImpl implements ChargesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ChargesService { - @Headers({"Content-Type: application/json"}) + public interface ChargesService { + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Consumption/charges") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @QueryParam("$filter") String filter, - @QueryParam("$apply") String apply, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, + @QueryParam("$filter") String filter, @QueryParam("$apply") String apply, + @HeaderParam("Accept") String accept, Context context); } /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * 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 (:). + * 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. + * 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. + * @return result of listing charge summary along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scope, String startDate, String endDate, String filter, String apply) { + private Mono> listWithResponseAsync(String scope, String startDate, String endDate, + String filter, String apply) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - scope, - this.client.getApiVersion(), - startDate, - endDate, - filter, - apply, - accept, - context)) + .withContext(context -> service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), + startDate, endDate, filter, apply, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * 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 (:). + * 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. + * 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync( - String scope, String startDate, String endDate, String filter, String apply, Context context) { + private Mono> listWithResponseAsync(String scope, String startDate, String endDate, + String filter, String apply, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - scope, - this.client.getApiVersion(), - startDate, - endDate, - filter, - apply, - accept, - context); - } - - /** - * 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}' - * 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(); - } - }); + return service.list(this.client.getEndpoint(), scope, this.client.getApiVersion(), startDate, endDate, filter, + apply, accept, context); } /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing charge summary. + * @return result of listing charge summary on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono listAsync(String scope) { @@ -268,85 +193,76 @@ 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())); } /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * 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. + * @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(); } /** * 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}' - * 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. - * @param context The context to associate with this operation. + * '/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of listing 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 f698da520154..728351550e33 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,40 +12,36 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ChargesImpl( - ChargesClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public ChargesImpl(ChargesClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public ChargesListResult list(String scope) { - ChargesListResultInner inner = this.serviceClient().list(scope); + public Response listWithResponse(String scope, String startDate, String endDate, String filter, + String apply, Context context) { + Response inner + = this.serviceClient().listWithResponse(scope, startDate, endDate, filter, apply, context); if (inner != null) { - return new ChargesListResultImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ChargesListResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response listWithResponse( - String scope, String startDate, String endDate, String filter, String apply, Context context) { - Response inner = - this.serviceClient().listWithResponse(scope, startDate, endDate, filter, apply, context); + public ChargesListResult list(String scope) { + ChargesListResultInner inner = this.serviceClient().list(scope); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ChargesListResultImpl(inner.getValue(), this.manager())); + return new ChargesListResultImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesListResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesListResultImpl.java index 4591a66ca59e..60438e1c331e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesListResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ChargesListResultImpl.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.consumption.implementation; import com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner; -import com.azure.resourcemanager.consumption.models.ChargeSummary; import com.azure.resourcemanager.consumption.models.ChargesListResult; +import com.azure.resourcemanager.consumption.models.ChargeSummary; import java.util.Collections; import java.util.List; @@ -15,8 +15,8 @@ public final class ChargesListResultImpl implements ChargesListResult { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ChargesListResultImpl( - ChargesListResultInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + ChargesListResultImpl(ChargesListResultInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ConsumptionManagementClientBuilder.java index efd5a406aff6..5679df0a7f0f 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; @@ -15,8 +14,10 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the ConsumptionManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ConsumptionManagementClientImpl.class}) +/** + * A builder for creating a new instance of the ConsumptionManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ConsumptionManagementClientImpl.class }) public final class ConsumptionManagementClientBuilder { /* * Azure Subscription ID. @@ -25,7 +26,7 @@ public final class ConsumptionManagementClientBuilder { /** * Sets Azure Subscription ID. - * + * * @param subscriptionId the subscriptionId value. * @return the ConsumptionManagementClientBuilder. */ @@ -41,7 +42,7 @@ public ConsumptionManagementClientBuilder subscriptionId(String subscriptionId) /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the ConsumptionManagementClientBuilder. */ @@ -57,7 +58,7 @@ public ConsumptionManagementClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the ConsumptionManagementClientBuilder. */ @@ -67,34 +68,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. - * - * @param defaultPollInterval the defaultPollInterval value. + * Sets The HTTP pipeline to send requests through. + * + * @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. - * - * @param pipeline the pipeline value. + * Sets The default poll interval for long-running operation. + * + * @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; } @@ -105,7 +106,7 @@ public ConsumptionManagementClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the ConsumptionManagementClientBuilder. */ @@ -116,31 +117,22 @@ public ConsumptionManagementClientBuilder serializerAdapter(SerializerAdapter se /** * Builds an instance of ConsumptionManagementClientImpl with the provided parameters. - * + * * @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(); - } - ConsumptionManagementClientImpl client = - new ConsumptionManagementClientImpl( - pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + 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(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.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 d4a20bf01a4c..b14624f2b1c7 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 @@ -5,6 +5,7 @@ package com.azure.resourcemanager.consumption.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,9 +13,10 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; 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; @@ -34,9 +36,9 @@ import com.azure.resourcemanager.consumption.fluent.PriceSheetsClient; import com.azure.resourcemanager.consumption.fluent.ReservationRecommendationDetailsClient; import com.azure.resourcemanager.consumption.fluent.ReservationRecommendationsClient; -import com.azure.resourcemanager.consumption.fluent.ReservationTransactionsClient; import com.azure.resourcemanager.consumption.fluent.ReservationsDetailsClient; import com.azure.resourcemanager.consumption.fluent.ReservationsSummariesClient; +import com.azure.resourcemanager.consumption.fluent.ReservationTransactionsClient; import com.azure.resourcemanager.consumption.fluent.TagsClient; import com.azure.resourcemanager.consumption.fluent.UsageDetailsClient; import java.io.IOException; @@ -45,285 +47,330 @@ 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. */ +/** + * 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. */ + /** + * Azure Subscription ID. + */ private final String subscriptionId; /** * Gets Azure Subscription ID. - * + * * @return the subscriptionId value. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The UsageDetailsClient object to access its operations. */ + /** + * The UsageDetailsClient object to access its operations. + */ private final UsageDetailsClient usageDetails; /** * Gets the UsageDetailsClient object to access its operations. - * + * * @return the UsageDetailsClient object. */ public UsageDetailsClient getUsageDetails() { return this.usageDetails; } - /** The MarketplacesClient object to access its operations. */ + /** + * The MarketplacesClient object to access its operations. + */ private final MarketplacesClient marketplaces; /** * Gets the MarketplacesClient object to access its operations. - * + * * @return the MarketplacesClient object. */ public MarketplacesClient getMarketplaces() { return this.marketplaces; } - /** The BudgetsClient object to access its operations. */ + /** + * The BudgetsClient object to access its operations. + */ private final BudgetsClient budgets; /** * Gets the BudgetsClient object to access its operations. - * + * * @return the BudgetsClient object. */ public BudgetsClient getBudgets() { return this.budgets; } - /** The TagsClient object to access its operations. */ + /** + * The TagsClient object to access its operations. + */ private final TagsClient tags; /** * Gets the TagsClient object to access its operations. - * + * * @return the TagsClient object. */ public TagsClient getTags() { return this.tags; } - /** The ChargesClient object to access its operations. */ + /** + * The ChargesClient object to access its operations. + */ private final ChargesClient charges; /** * Gets the ChargesClient object to access its operations. - * + * * @return the ChargesClient object. */ public ChargesClient getCharges() { return this.charges; } - /** The BalancesClient object to access its operations. */ + /** + * The BalancesClient object to access its operations. + */ private final BalancesClient balances; /** * Gets the BalancesClient object to access its operations. - * + * * @return the BalancesClient object. */ public BalancesClient getBalances() { return this.balances; } - /** The ReservationsSummariesClient object to access its operations. */ + /** + * The ReservationsSummariesClient object to access its operations. + */ private final ReservationsSummariesClient reservationsSummaries; /** * Gets the ReservationsSummariesClient object to access its operations. - * + * * @return the ReservationsSummariesClient object. */ public ReservationsSummariesClient getReservationsSummaries() { return this.reservationsSummaries; } - /** The ReservationsDetailsClient object to access its operations. */ + /** + * The ReservationsDetailsClient object to access its operations. + */ private final ReservationsDetailsClient reservationsDetails; /** * Gets the ReservationsDetailsClient object to access its operations. - * + * * @return the ReservationsDetailsClient object. */ public ReservationsDetailsClient getReservationsDetails() { return this.reservationsDetails; } - /** The ReservationRecommendationsClient object to access its operations. */ + /** + * The ReservationRecommendationsClient object to access its operations. + */ private final ReservationRecommendationsClient reservationRecommendations; /** * Gets the ReservationRecommendationsClient object to access its operations. - * + * * @return the ReservationRecommendationsClient object. */ public ReservationRecommendationsClient getReservationRecommendations() { return this.reservationRecommendations; } - /** The ReservationRecommendationDetailsClient object to access its operations. */ + /** + * The ReservationRecommendationDetailsClient object to access its operations. + */ private final ReservationRecommendationDetailsClient reservationRecommendationDetails; /** * Gets the ReservationRecommendationDetailsClient object to access its operations. - * + * * @return the ReservationRecommendationDetailsClient object. */ public ReservationRecommendationDetailsClient getReservationRecommendationDetails() { return this.reservationRecommendationDetails; } - /** The ReservationTransactionsClient object to access its operations. */ + /** + * The ReservationTransactionsClient object to access its operations. + */ private final ReservationTransactionsClient reservationTransactions; /** * Gets the ReservationTransactionsClient object to access its operations. - * + * * @return the ReservationTransactionsClient object. */ public ReservationTransactionsClient getReservationTransactions() { return this.reservationTransactions; } - /** The PriceSheetsClient object to access its operations. */ + /** + * The PriceSheetsClient object to access its operations. + */ private final PriceSheetsClient priceSheets; /** * Gets the PriceSheetsClient object to access its operations. - * + * * @return the PriceSheetsClient object. */ public PriceSheetsClient getPriceSheets() { return this.priceSheets; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The AggregatedCostsClient object to access its operations. */ + /** + * The AggregatedCostsClient object to access its operations. + */ private final AggregatedCostsClient aggregatedCosts; /** * Gets the AggregatedCostsClient object to access its operations. - * + * * @return the AggregatedCostsClient object. */ public AggregatedCostsClient getAggregatedCosts() { return this.aggregatedCosts; } - /** The EventsOperationsClient object to access its operations. */ + /** + * The EventsOperationsClient object to access its operations. + */ private final EventsOperationsClient eventsOperations; /** * Gets the EventsOperationsClient object to access its operations. - * + * * @return the EventsOperationsClient object. */ public EventsOperationsClient getEventsOperations() { return this.eventsOperations; } - /** The LotsOperationsClient object to access its operations. */ + /** + * The LotsOperationsClient object to access its operations. + */ private final LotsOperationsClient lotsOperations; /** * Gets the LotsOperationsClient object to access its operations. - * + * * @return the LotsOperationsClient object. */ public LotsOperationsClient getLotsOperations() { return this.lotsOperations; } - /** The CreditsClient object to access its operations. */ + /** + * The CreditsClient object to access its operations. + */ private final CreditsClient credits; /** * Gets the CreditsClient object to access its operations. - * + * * @return the CreditsClient object. */ public CreditsClient getCredits() { @@ -332,7 +379,7 @@ public CreditsClient getCredits() { /** * Initializes an instance of ConsumptionManagementClient client. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. @@ -340,19 +387,14 @@ public CreditsClient getCredits() { * @param subscriptionId Azure Subscription ID. * @param endpoint server parameter. */ - ConsumptionManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + ConsumptionManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2021-10-01"; + this.apiVersion = "2023-11-01"; this.usageDetails = new UsageDetailsClientImpl(this); this.marketplaces = new MarketplacesClientImpl(this); this.budgets = new BudgetsClientImpl(this); @@ -374,7 +416,7 @@ public CreditsClient getCredits() { /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -383,20 +425,17 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @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); } /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -406,26 +445,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -438,24 +466,21 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -491,7 +516,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { @@ -514,4 +539,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 b82df9ee09f2..a0732561f906 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,16 +9,14 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - CreditSummaryImpl( - CreditSummaryInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + CreditSummaryImpl(CreditSummaryInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -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 0167b867175e..f45fb91e37d4 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,24 +21,27 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final CreditsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of CreditsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ CreditsClientImpl(ConsumptionManagementClientImpl client) { @@ -52,39 +55,32 @@ public final class CreditsClientImpl implements CreditsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface CreditsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/credits/balanceSummary") - @ExpectedResponses({200, 204}) + public interface CreditsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/credits/balanceSummary") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingProfileId") String billingProfileId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** * The credit summary by billingAccountId and billingProfileId. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a credit summary resource. + * @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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -96,38 +92,28 @@ private Mono> getWithResponseAsync(String billingAc } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), billingAccountId, billingProfileId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The credit summary by billingAccountId and billingProfileId. - * + * * @param 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} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String billingAccountId, String billingProfileId, Context context) { + private Mono> getWithResponseAsync(String billingAccountId, String billingProfileId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -139,68 +125,55 @@ private Mono> getWithResponseAsync( } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), billingAccountId, billingProfileId, this.client.getApiVersion(), + accept, context); } /** * The credit summary by billingAccountId and billingProfileId. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a credit summary resource. + * @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())); } /** * 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 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(); } /** * 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 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 0a36ba8d42d2..508fb5baaf9a 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 @@ -10,41 +10,37 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.consumption.fluent.CreditsClient; 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; +import com.azure.resourcemanager.consumption.models.CreditSummary; 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public CreditsImpl( - CreditsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public CreditsImpl(CreditsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public CreditSummary get(String billingAccountId, String billingProfileId) { - CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); + public Response getWithResponse(String billingAccountId, String billingProfileId, Context context) { + Response inner + = this.serviceClient().getWithResponse(billingAccountId, billingProfileId, context); if (inner != null) { - return new CreditSummaryImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CreditSummaryImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse(String billingAccountId, String billingProfileId, Context context) { - Response inner = - this.serviceClient().getWithResponse(billingAccountId, billingProfileId, context); + public CreditSummary get(String billingAccountId, String billingProfileId) { + CreditSummaryInner inner = this.serviceClient().get(billingAccountId, billingProfileId); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CreditSummaryImpl(inner.getValue(), this.manager())); + return new CreditSummaryImpl(inner, this.manager()); } else { return null; } 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 6cc49c40a576..5fbf293916c1 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 @@ -17,8 +17,8 @@ public final class EventSummaryImpl implements EventSummary { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - EventSummaryImpl( - EventSummaryInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + EventSummaryImpl(EventSummaryInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -67,6 +67,14 @@ public Amount closedBalance() { return this.innerModel().closedBalance(); } + public String billingAccountId() { + return this.innerModel().billingAccountId(); + } + + public String billingAccountDisplayName() { + return this.innerModel().billingAccountDisplayName(); + } + public EventType eventType() { return this.innerModel().eventType(); } @@ -127,6 +135,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 669bd221ad8d..696e34491428 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,30 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in EventsOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final EventsOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of EventsOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ EventsOperationsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(EventsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(EventsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,60 +61,44 @@ public final class EventsOperationsClientImpl implements EventsOperationsClient */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface EventsOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/events") - @ExpectedResponses({200}) + public interface EventsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/events") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, + Mono> listByBillingProfile(@HostParam("$host") String endpoint, @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingProfileId") String billingProfileId, - @QueryParam("api-version") String apiVersion, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, + @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/events") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @PathParam("billingAccountId") String billingAccountId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingAccount(@HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingProfileNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingAccountNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -119,16 +106,15 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate) { + private Mono> listByBillingProfileSinglePageAsync(String billingAccountId, + String billingProfileId, String startDate, String endDate) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -146,34 +132,17 @@ private Mono> listByBillingProfileSinglePageAsy } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - startDate, - endDate, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByBillingProfile(this.client.getEndpoint(), billingAccountId, + billingProfileId, this.client.getApiVersion(), startDate, endDate, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -182,16 +151,15 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + private Mono> listByBillingProfileSinglePageAsync(String billingAccountId, + String billingProfileId, String startDate, String endDate, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -210,30 +178,16 @@ private Mono> listByBillingProfileSinglePageAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - startDate, - endDate, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByBillingProfile(this.client.getEndpoint(), billingAccountId, billingProfileId, + this.client.getApiVersion(), startDate, endDate, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -241,11 +195,11 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate) { + private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId, + String startDate, String endDate) { return new PagedFlux<>( () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); @@ -254,7 +208,7 @@ private PagedFlux listByBillingProfileAsync( /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -263,11 +217,11 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId, + String startDate, String endDate, Context context) { return new PagedFlux<>( () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, startDate, endDate, context), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); @@ -276,7 +230,7 @@ private PagedFlux listByBillingProfileAsync( /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -284,18 +238,18 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate) { + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate) { return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -304,11 +258,11 @@ 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( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate, Context context) { return new PagedIterable<>( listByBillingProfileAsync(billingAccountId, billingProfileId, startDate, endDate, context)); } @@ -316,24 +270,23 @@ public PagedIterable listByBillingProfile( /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountId, String filter) { + private Mono> listByBillingAccountSinglePageAsync(String billingAccountId, + String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -341,50 +294,34 @@ private Mono> listByBillingAccountSinglePageAsy } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), - billingAccountId, - this.client.getApiVersion(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByBillingAccount(this.client.getEndpoint(), billingAccountId, + this.client.getApiVersion(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountId, String filter, Context context) { + private Mono> listByBillingAccountSinglePageAsync(String billingAccountId, + String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -393,88 +330,78 @@ private Mono> listByBillingAccountSinglePageAsy final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByBillingAccount(this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId) { final String filter = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingAccountAsync( - String billingAccountId, String filter, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter, + Context context) { + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByBillingAccount(String billingAccountId) { @@ -485,31 +412,34 @@ public PagedIterable listByBillingAccount(String billingAccou /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountId, String filter, Context context) { + public PagedIterable listByBillingAccount(String billingAccountId, String filter, + Context context) { return new PagedIterable<>(listByBillingAccountAsync(billingAccountId, 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 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) { @@ -517,72 +447,59 @@ private Mono> listByBillingProfileNextSinglePag 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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) { @@ -590,61 +507,45 @@ private Mono> listByBillingAccountNextSinglePag 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/EventsOperationsImpl.java index 4e5f0b2bd8f4..99077b291af2 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 @@ -9,46 +9,45 @@ 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.EventSummary; import com.azure.resourcemanager.consumption.models.EventsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.consumption.models.EventSummary; 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public EventsOperationsImpl( - EventsOperationsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public EventsOperationsImpl(EventsOperationsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, String startDate, String endDate) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate); - return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate) { + PagedIterable inner + = this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, String startDate, String endDate, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate, context); - return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String startDate, String endDate, Context context) { + PagedIterable inner = this.serviceClient() + .listByBillingProfile(billingAccountId, billingProfileId, startDate, endDate, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } public PagedIterable listByBillingAccount(String billingAccountId) { PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); - return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountId, filter, context); - return Utils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByBillingAccount(billingAccountId, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new EventSummaryImpl(inner1, this.manager())); } private EventsOperationsClient serviceClient() { 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 f368ffca6d3b..210c06b1a144 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 @@ -9,6 +9,7 @@ import com.azure.resourcemanager.consumption.models.AmountWithExchangeRate; import com.azure.resourcemanager.consumption.models.LotSource; import com.azure.resourcemanager.consumption.models.LotSummary; +import com.azure.resourcemanager.consumption.models.OrganizationType; import com.azure.resourcemanager.consumption.models.Reseller; import com.azure.resourcemanager.consumption.models.Status; import java.time.OffsetDateTime; @@ -18,8 +19,8 @@ public final class LotSummaryImpl implements LotSummary { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - LotSummaryImpl( - LotSummaryInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + LotSummaryImpl(LotSummaryInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -92,10 +93,22 @@ public Reseller reseller() { return this.innerModel().reseller(); } + public Boolean isEstimatedBalance() { + return this.innerModel().isEstimatedBalance(); + } + public String etagPropertiesEtag() { return this.innerModel().etagPropertiesEtag(); } + public OrganizationType organizationType() { + return this.innerModel().organizationType(); + } + + public Amount usedAmount() { + return this.innerModel().usedAmount(); + } + public LotSummaryInner innerModel() { return this.innerObject; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/LotsOperationsClientImpl.java index e17ef7138dbc..772e3cefedab 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,30 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in LotsOperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final LotsOperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of LotsOperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ LotsOperationsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(LotsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(LotsOperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,73 +61,72 @@ public final class LotsOperationsClientImpl implements LotsOperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface LotsOperationsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}" - + "/providers/Microsoft.Consumption/lots") - @ExpectedResponses({200}) + public interface LotsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/lots") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfile( - @HostParam("$host") String endpoint, + Mono> listByBillingProfile(@HostParam("$host") String endpoint, @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingProfileId") String billingProfileId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @PathParam("billingProfileId") String billingProfileId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption/lots") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccount( - @HostParam("$host") String endpoint, - @PathParam("billingAccountId") String billingAccountId, - @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingAccount(@HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, @QueryParam("api-version") String apiVersion, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/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"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingProfileNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByBillingAccountNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listByBillingAccountNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> 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( - String billingAccountId, String billingProfileId) { + private Mono> listByBillingProfileSinglePageAsync(String billingAccountId, + String billingProfileId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -136,48 +138,31 @@ private Mono> listByBillingProfileSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByBillingProfile(this.client.getEndpoint(), billingAccountId, + billingProfileId, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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. * @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> listByBillingProfileSinglePageAsync( - String billingAccountId, String billingProfileId, Context context) { + private Mono> listByBillingProfileSinglePageAsync(String billingAccountId, + String billingProfileId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -190,72 +175,58 @@ private Mono> listByBillingProfileSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), - billingAccountId, - billingProfileId, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByBillingProfile(this.client.getEndpoint(), billingAccountId, billingProfileId, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId), + return new PagedFlux<>(() -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByBillingProfileAsync( - String billingAccountId, String billingProfileId, Context context) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, context), + private PagedFlux listByBillingProfileAsync(String billingAccountId, String billingProfileId, + Context context) { + return new PagedFlux<>(() -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, context), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, context)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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,44 +234,42 @@ 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. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, Context context) { + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + Context context) { return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, context)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing lot summary. + * @return result of listing lot summary along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByBillingAccountSinglePageAsync( - String billingAccountId, String filter) { + private Mono> listByBillingAccountSinglePageAsync(String billingAccountId, + String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -308,50 +277,33 @@ private Mono> listByBillingAccountSinglePageAsync } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByBillingAccount( - this.client.getEndpoint(), - billingAccountId, - this.client.getApiVersion(), - filter, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByBillingAccount(this.client.getEndpoint(), billingAccountId, + this.client.getApiVersion(), filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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( - String billingAccountId, String filter, Context context) { + private Mono> listByBillingAccountSinglePageAsync(String billingAccountId, + String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -360,88 +312,78 @@ private Mono> listByBillingAccountSinglePageAsync final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingAccount( - this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByBillingAccount(this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), filter, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing lot summary. + * @return result of listing lot summary as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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) { final String filter = null; - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter), + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing 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, Context context) { - return new PagedFlux<>( - () -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), + private PagedFlux listByBillingAccountAsync(String billingAccountId, String filter, + Context context) { + return new PagedFlux<>(() -> listByBillingAccountSinglePageAsync(billingAccountId, filter, context), nextLink -> listByBillingAccountNextSinglePageAsync(nextLink, context)); } /** - * Lists all Azure credits and Microsoft Azure consumption commitments for a billing account or a billing profile. - * Microsoft Azure consumption commitments are only supported for the billing account scope. - * + * 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,33 +392,203 @@ 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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing lot summary. + * @return result of listing lot summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByBillingAccount( - String billingAccountId, String filter, Context context) { + public PagedIterable listByBillingAccount(String billingAccountId, String filter, + Context context) { 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) { @@ -484,72 +596,57 @@ private Mono> listByBillingProfileNextSinglePageA 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByBillingProfileNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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) { @@ -557,61 +654,100 @@ private Mono> listByBillingAccountNextSinglePageA 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByBillingAccountNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByBillingAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return 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 82f0b140a011..e6474fdad336 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 @@ -9,45 +9,56 @@ 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.LotSummary; import com.azure.resourcemanager.consumption.models.LotsOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.resourcemanager.consumption.models.LotSummary; 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public LotsOperationsImpl( - LotsOperationsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public LotsOperationsImpl(LotsOperationsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); - return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, context); - return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + public PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + Context context) { + PagedIterable inner + = this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } public PagedIterable listByBillingAccount(String billingAccountId) { PagedIterable inner = this.serviceClient().listByBillingAccount(billingAccountId); - return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } public PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingAccount(billingAccountId, filter, context); - return Utils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByBillingAccount(billingAccountId, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); + } + + public PagedIterable listByCustomer(String billingAccountId, String customerId) { + PagedIterable inner = this.serviceClient().listByCustomer(billingAccountId, customerId); + return ResourceManagerUtils.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 ResourceManagerUtils.mapPage(inner, inner1 -> new LotSummaryImpl(inner1, this.manager())); } private LotsOperationsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java index 8ea750f2cf16..50b94db9b1d6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ManagementGroupAggregatedCostResultImpl.java @@ -18,8 +18,7 @@ public final class ManagementGroupAggregatedCostResultImpl implements Management private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ManagementGroupAggregatedCostResultImpl( - ManagementGroupAggregatedCostResultInner innerObject, + ManagementGroupAggregatedCostResultImpl(ManagementGroupAggregatedCostResultInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -81,12 +80,9 @@ public String currency() { public List children() { List inner = this.innerModel().children(); if (inner != null) { - return Collections - .unmodifiableList( - inner - .stream() - .map(inner1 -> new ManagementGroupAggregatedCostResultImpl(inner1, this.manager())) - .collect(Collectors.toList())); + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new ManagementGroupAggregatedCostResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); } else { return Collections.emptyList(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java index cd69589cad40..bcc62322278b 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplaceImpl.java @@ -17,8 +17,8 @@ public final class MarketplaceImpl implements Marketplace { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - MarketplaceImpl( - MarketplaceInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + MarketplaceImpl(MarketplaceInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesClientImpl.java index 0584db96fe5a..47829d288b4a 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,30 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in MarketplacesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final MarketplacesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of MarketplacesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ MarketplacesClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(MarketplacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(MarketplacesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,129 +61,100 @@ public final class MarketplacesClientImpl implements MarketplacesClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface MarketplacesService { - @Headers({"Content-Type: application/json"}) + 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, - @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, - @QueryParam("$skiptoken") String skiptoken, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, + @QueryParam("$skiptoken") String skiptoken, @PathParam(value = "scope", encoded = true) String scope, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String scope, String filter, Integer top, String skiptoken) { + private Mono> listSinglePageAsync(String scope, String filter, Integer top, + String skiptoken) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - top, - skiptoken, - scope, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), filter, top, skiptoken, scope, + this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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 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> listSinglePageAsync( - String scope, String filter, Integer top, String skiptoken, Context context) { + private Mono> listSinglePageAsync(String scope, String filter, Integer top, + String skiptoken, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -188,128 +162,120 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), filter, top, skiptoken, scope, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), filter, top, skiptoken, scope, this.client.getApiVersion(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, top, skiptoken), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, top, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { final String filter = null; final Integer top = null; final String skiptoken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, top, skiptoken), nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, top, skiptoken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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 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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String filter, Integer top, String skiptoken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, top, skiptoken, context), + private PagedFlux listAsync(String scope, String filter, Integer top, String skiptoken, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, filter, top, skiptoken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -322,43 +288,45 @@ public PagedIterable list(String scope) { /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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 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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, String filter, Integer top, String skiptoken, Context context) { + public PagedIterable list(String scope, String filter, Integer top, String skiptoken, + Context context) { return new PagedIterable<>(listAsync(scope, filter, top, skiptoken, 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 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) { @@ -366,35 +334,27 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -402,23 +362,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/MarketplacesImpl.java index 5cab05762de7..acaf4822095c 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,30 +11,29 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public MarketplacesImpl( - MarketplacesClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public MarketplacesImpl(MarketplacesClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new MarketplaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceImpl(inner1, this.manager())); } - public PagedIterable list( - String scope, String filter, Integer top, String skiptoken, Context context) { + public PagedIterable list(String scope, String filter, Integer top, String skiptoken, + Context context) { PagedIterable inner = this.serviceClient().list(scope, filter, top, skiptoken, context); - return Utils.mapPage(inner, inner1 -> new MarketplaceImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new MarketplaceImpl(inner1, this.manager())); } private MarketplacesClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ModernReservationTransactionImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ModernReservationTransactionImpl.java index 85ae0dfc115c..09b3b564fb12 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ModernReservationTransactionImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ModernReservationTransactionImpl.java @@ -17,8 +17,7 @@ public final class ModernReservationTransactionImpl implements ModernReservation private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ModernReservationTransactionImpl( - ModernReservationTransactionInner innerObject, + ModernReservationTransactionImpl(ModernReservationTransactionInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; 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 000000000000..eec591cc4f35 --- /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 9146d37513df..1ba389a677c1 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,30 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -58,97 +61,74 @@ public final class OperationsClientImpl implements OperationsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface OperationsService { - @Headers({"Content-Type: application/json"}) + public interface OperationsService { + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Consumption/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * Lists all of the available consumption REST API operations. - * + * * @throws ManagementException thrown if 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() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>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 of the available consumption REST API operations. - * + * * @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> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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 - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Lists all of the available consumption REST API operations. - * + * * @throws ManagementException thrown if 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() { @@ -157,25 +137,25 @@ private PagedFlux listAsync() { /** * Lists all of the available consumption REST API operations. - * + * * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Lists all of the available consumption REST API operations. - * + * * @throws ManagementException thrown if 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() { @@ -184,12 +164,12 @@ public PagedIterable list() { /** * Lists all of the available consumption REST API operations. - * + * * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -198,12 +178,15 @@ 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) { @@ -211,35 +194,28 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -247,23 +223,13 @@ private Mono> listNextSinglePageAsync(String nextL 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/OperationsImpl.java index d7b61340083e..e2fe8e1e59ea 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,29 +11,28 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java index 0ebe7ef97d38..9a48dbec5079 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetResultImpl.java @@ -17,8 +17,8 @@ public final class PriceSheetResultImpl implements PriceSheetResult { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - PriceSheetResultImpl( - PriceSheetResultInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + PriceSheetResultImpl(PriceSheetResultInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/PriceSheetsClientImpl.java index e01c7433932a..a39045b01289 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,31 +20,40 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final PriceSheetsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of PriceSheetsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ PriceSheetsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(PriceSheetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(PriceSheetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -53,244 +63,177 @@ public final class PriceSheetsClientImpl implements PriceSheetsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface PriceSheetsService { - @Headers({"Content-Type: application/json"}) + public interface PriceSheetsService { + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Consumption/pricesheets/default") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, - @QueryParam("$skiptoken") String skiptoken, - @QueryParam("$top") Integer top, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("$top") Integer top, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers" - + "/Microsoft.Consumption/pricesheets/default") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}/providers/Microsoft.Consumption/pricesheets/default") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByBillingPeriod( - @HostParam("$host") String endpoint, - @QueryParam("$expand") String expand, - @QueryParam("$skiptoken") String skiptoken, - @QueryParam("$top") Integer top, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("api-version") String apiVersion, - @PathParam("billingPeriodName") String billingPeriodName, - @HeaderParam("Accept") String accept, + Mono> getByBillingPeriod(@HostParam("$host") String endpoint, + @QueryParam("$expand") String expand, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("$top") Integer top, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @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); } /** * 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. + * 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. + * 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. + * @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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - expand, - skiptoken, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), expand, skiptoken, top, + this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. + * 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. + * 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 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, Context context) { + private Mono> getWithResponseAsync(String expand, String skiptoken, Integer top, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - expand, - skiptoken, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - accept, - context); + return service.get(this.client.getEndpoint(), expand, skiptoken, top, this.client.getSubscriptionId(), + this.client.getApiVersion(), accept, 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(); - } - }); + return getWithResponseAsync(expand, skiptoken, top).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * 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 ManagementException 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 PriceSheetResultInner get() { - final String expand = null; - final String skiptoken = null; - final Integer top = null; - return getAsync(expand, skiptoken, top).block(); + public Response getWithResponse(String expand, String skiptoken, Integer top, + Context context) { + 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. - * - * @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 subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String expand, String skiptoken, Integer top, Context context) { - return getWithResponseAsync(expand, skiptoken, top, context).block(); + 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. - * + * * @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. + * 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. + * 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 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( - String billingPeriodName, String expand, String skiptoken, Integer top) { + private Mono> getByBillingPeriodWithResponseAsync(String billingPeriodName, + String expand, String skiptoken, Integer top) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (billingPeriodName == null) { return Mono @@ -298,53 +241,39 @@ private Mono> getByBillingPeriodWithResponseAsyn } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .getByBillingPeriod( - this.client.getEndpoint(), - expand, - skiptoken, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - billingPeriodName, - accept, - context)) + .withContext(context -> service.getByBillingPeriod(this.client.getEndpoint(), expand, skiptoken, top, + this.client.getSubscriptionId(), 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. - * + * * @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. + * 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. + * 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} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByBillingPeriodWithResponseAsync( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context) { + private Mono> getByBillingPeriodWithResponseAsync(String billingPeriodName, + String expand, String skiptoken, Integer top, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (billingPeriodName == null) { return Mono @@ -352,79 +281,57 @@ private Mono> getByBillingPeriodWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .getByBillingPeriod( - this.client.getEndpoint(), - expand, - skiptoken, - top, - this.client.getSubscriptionId(), - this.client.getApiVersion(), - billingPeriodName, - accept, - context); + return service.getByBillingPeriod(this.client.getEndpoint(), expand, skiptoken, top, + this.client.getSubscriptionId(), this.client.getApiVersion(), billingPeriodName, accept, 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. - * @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 scope by subscriptionId and billing period. + * @return the price sheet for a scope by subscriptionId and billing period on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByBillingPeriodAsync( - String billingPeriodName, String expand, String skiptoken, Integer top) { + private Mono getByBillingPeriodAsync(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(); - } - }); + .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. - * + * * @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 price sheet for a scope by subscriptionId and billing period along with {@link Response}. */ @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( - (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(); } /** * 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. @@ -436,29 +343,213 @@ public PriceSheetResultInner getByBillingPeriod(String billingPeriodName) { final String expand = null; final String skiptoken = null; final Integer top = null; - return getByBillingPeriodAsync(billingPeriodName, expand, skiptoken, top).block(); + 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 status of the long running operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + 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())); + } + + /** + * 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 88be3122b0c3..4b9a67ffbd2c 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,24 +9,35 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public PriceSheetsImpl( - PriceSheetsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public PriceSheetsImpl(PriceSheetsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } + public Response getWithResponse(String expand, String skiptoken, Integer top, Context context) { + Response inner = this.serviceClient().getWithResponse(expand, skiptoken, top, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new PriceSheetResultImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + public PriceSheetResult get() { PriceSheetResultInner inner = this.serviceClient().get(); if (inner != null) { @@ -36,13 +47,12 @@ public PriceSheetResult get() { } } - public Response getWithResponse(String expand, String skiptoken, Integer top, Context context) { - Response inner = this.serviceClient().getWithResponse(expand, skiptoken, top, context); + public Response getByBillingPeriodWithResponse(String billingPeriodName, String expand, + String skiptoken, Integer top, Context context) { + Response inner + = this.serviceClient().getByBillingPeriodWithResponse(billingPeriodName, expand, skiptoken, top, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new PriceSheetResultImpl(inner.getValue(), this.manager())); } else { return null; @@ -58,16 +68,22 @@ public PriceSheetResult getByBillingPeriod(String billingPeriodName) { } } - public Response getByBillingPeriodWithResponse( - String billingPeriodName, String expand, String skiptoken, Integer top, Context context) { - Response inner = - this.serviceClient().getByBillingPeriodWithResponse(billingPeriodName, expand, skiptoken, top, context); + public OperationStatus downloadByBillingAccountPeriod(String billingAccountId, String billingPeriodName) { + OperationStatusInner inner + = this.serviceClient().downloadByBillingAccountPeriod(billingAccountId, billingPeriodName); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new PriceSheetResultImpl(inner.getValue(), this.manager())); + 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; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java index 62cc2ebaf7ad..f8091010404f 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationDetailImpl.java @@ -16,8 +16,8 @@ public final class ReservationDetailImpl implements ReservationDetail { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ReservationDetailImpl( - ReservationDetailInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + ReservationDetailImpl(ReservationDetailInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsClientImpl.java index 309f8e08f003..0c22ab0261f8 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,26 +32,24 @@ * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ReservationRecommendationDetailsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ReservationRecommendationDetailsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReservationRecommendationDetailsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy - .create( - ReservationRecommendationDetailsService.class, - client.getHttpPipeline(), - client.getSerializerAdapter()); + this.service = RestProxy.create(ReservationRecommendationDetailsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -61,50 +59,50 @@ public final class ReservationRecommendationDetailsClientImpl implements Reserva */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationRecommendationDetailsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendationDetails") - @ExpectedResponses({200, 204}) + public interface ReservationRecommendationDetailsService { + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationRecommendationDetails") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("region") String region, - @QueryParam("term") Term term, - @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, - @QueryParam("product") String product, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "resourceScope", encoded = true) String resourceScope, @QueryParam("scope") Scope scope, + @QueryParam("region") String region, @QueryParam("term") Term term, + @QueryParam("lookBackPeriod") LookBackPeriod lookBackPeriod, @QueryParam("product") String product, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, 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 - * '/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 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @param filter Used to filter reservation recommendation details by: properties/subscriptionId can be specified + * for billing account and billing profile paths. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) { + private Mono> getWithResponseAsync(String resourceScope, + Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -123,50 +121,44 @@ private Mono> getWithRespon } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - scope, - region, - term, - lookBackPeriod, - product, - accept, - context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceScope, + scope, region, term, lookBackPeriod, product, filter, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Details of a reservation recommendation for what-if analysis of reserved instances. - * - * @param scope The scope associated with reservation recommendation details operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resource group scope, - * /providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope, and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @param 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @param filter Used to filter reservation recommendation details by: properties/subscriptionId can be specified + * for billing account and billing profile paths. * @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} 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) { + private Mono> getWithResponseAsync(String resourceScope, + Scope scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, String filter, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -185,100 +177,93 @@ private Mono> getWithRespon } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - scope, - region, - term, - lookBackPeriod, - product, - accept, - context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), resourceScope, scope, region, term, + lookBackPeriod, product, filter, accept, 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 - * '/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 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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(); - } - }); + private Mono getAsync(String resourceScope, Scope scope, String region, + Term term, LookBackPeriod lookBackPeriod, String product) { + final String filter = null; + return getWithResponseAsync(resourceScope, scope, region, term, lookBackPeriod, product, filter) + .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 - * '/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 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @param filter Used to filter reservation recommendation details by: properties/subscriptionId can be specified + * for billing account and billing profile paths. + * @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, String filter, Context context) { + return getWithResponseAsync(resourceScope, scope, region, term, lookBackPeriod, product, filter, 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 - * '/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 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. + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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) { + final String filter = null; + return getWithResponse(resourceScope, scope, region, term, lookBackPeriod, product, filter, 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 1116ec92642f..b66adeab04eb 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,44 +13,40 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ReservationRecommendationDetailsImpl( - ReservationRecommendationDetailsClient innerClient, + public ReservationRecommendationDetailsImpl(ReservationRecommendationDetailsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; 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); + public Response getWithResponse(String resourceScope, Scope scope, + String region, Term term, LookBackPeriod lookBackPeriod, String product, String filter, Context context) { + Response inner = this.serviceClient() + .getWithResponse(resourceScope, scope, region, term, lookBackPeriod, product, filter, context); if (inner != null) { - return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new ReservationRecommendationDetailsModelImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse( - String scope, String region, Term term, LookBackPeriod lookBackPeriod, String product, Context context) { - Response inner = - this.serviceClient().getWithResponse(scope, region, term, lookBackPeriod, product, context); + 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 SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ReservationRecommendationDetailsModelImpl(inner.getValue(), this.manager())); + return new ReservationRecommendationDetailsModelImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java index b60aeda8444c..e563f12d03bb 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationDetailsModelImpl.java @@ -17,8 +17,7 @@ public final class ReservationRecommendationDetailsModelImpl implements Reservat private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ReservationRecommendationDetailsModelImpl( - ReservationRecommendationDetailsModelInner innerObject, + ReservationRecommendationDetailsModelImpl(ReservationRecommendationDetailsModelInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java index 6f2667181453..b248f25e5573 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationImpl.java @@ -6,6 +6,7 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import com.azure.resourcemanager.consumption.models.ReservationRecommendation; +import com.azure.resourcemanager.consumption.models.ReservationRecommendationKind; import java.util.Collections; import java.util.Map; @@ -14,8 +15,7 @@ public final class ReservationRecommendationImpl implements ReservationRecommend private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ReservationRecommendationImpl( - ReservationRecommendationInner innerObject, + ReservationRecommendationImpl(ReservationRecommendationInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -33,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public ReservationRecommendationKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsClientImpl.java index 975c9309d1ab..98f0cd7af9e0 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,32 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ReservationRecommendationsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ReservationRecommendationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ReservationRecommendationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReservationRecommendationsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy - .create( - ReservationRecommendationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ReservationRecommendationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,253 +61,236 @@ public final class ReservationRecommendationsClientImpl implements ReservationRe */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationRecommendationsService { - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationRecommendations") - @ExpectedResponses({200, 204}) + public interface ReservationRecommendationsService { + @Headers({ "Content-Type: application/json" }) + @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, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List of recommendations for purchasing reserved instances. - * - * @param scope 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 - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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.")); + 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)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), filter, this.client.getApiVersion(), + resourceScope, 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())); } /** * List of recommendations for purchasing reserved instances. - * - * @param scope 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 - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @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 scope, String filter, Context context) { + private Mono> listSinglePageAsync(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.")); + 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) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), resourceScope, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List of recommendations for purchasing reserved instances. - * - * @param scope 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 - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile 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) { + 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @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 scope, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, filter, context), nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceScope, String filter, Context context) { + return new PagedFlux<>(() -> 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile 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) { + 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @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 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) { @@ -314,60 +298,43 @@ private Mono> listNextSinglePageAs 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationRecommendationsImpl.java index 654187b197f1..0446ca777b48 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,30 +11,28 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ReservationRecommendationsImpl( - ReservationRecommendationsClient innerClient, + public ReservationRecommendationsImpl(ReservationRecommendationsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new ReservationRecommendationImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope) { + PagedIterable inner = this.serviceClient().list(resourceScope); + return ResourceManagerUtils.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); - return Utils.mapPage(inner, inner1 -> new ReservationRecommendationImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope, String filter, Context context) { + PagedIterable inner = this.serviceClient().list(resourceScope, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationRecommendationImpl(inner1, this.manager())); } private ReservationRecommendationsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java index 6db8470ede12..522e085492aa 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationSummaryImpl.java @@ -16,8 +16,8 @@ public final class ReservationSummaryImpl implements ReservationSummary { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ReservationSummaryImpl( - ReservationSummaryInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + ReservationSummaryImpl(ReservationSummaryInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionImpl.java index 02770cf23b76..ab014b043dce 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionImpl.java @@ -17,8 +17,7 @@ public final class ReservationTransactionImpl implements ReservationTransaction private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - ReservationTransactionImpl( - ReservationTransactionInner innerObject, + ReservationTransactionImpl(ReservationTransactionInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsClientImpl.java index 6db0c98bfb33..8772f61271cf 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,33 +25,36 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ReservationTransactionsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ReservationTransactionsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReservationTransactionsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy - .create(ReservationTransactionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ReservationTransactionsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -61,76 +64,71 @@ public final class ReservationTransactionsClientImpl implements ReservationTrans */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationTransactionsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Consumption" - + "/reservationTransactions") - @ExpectedResponses({200}) + public interface ReservationTransactionsService { + @Headers({ "Content-Type: application/json" }) + @Get("/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, - @PathParam("billingAccountId") String billingAccountId, - @HeaderParam("Accept") String accept, + 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") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.Consumption/reservationTransactions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfile( - @HostParam("$host") String endpoint, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @PathParam("billingAccountId") String billingAccountId, - @PathParam("billingProfileId") String billingProfileId, - @HeaderParam("Accept") String accept, + @HostParam("$host") String endpoint, @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, @PathParam("billingAccountId") String billingAccountId, + @PathParam("billingProfileId") String billingProfileId, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByBillingProfileNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context 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. * @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) { + private Mono> listSinglePageAsync(String billingAccountId, String filter, + Boolean useMarkupIfPartner, BigDecimal previewMarkupPercentage) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -138,48 +136,40 @@ private Mono> listSinglePageAsync( } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - billingAccountId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), filter, this.client.getApiVersion(), + useMarkupIfPartner, previewMarkupPercentage, billingAccountId, 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())); } /** - * 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) { + private Mono> listSinglePageAsync(String billingAccountId, String filter, + Boolean useMarkupIfPartner, BigDecimal previewMarkupPercentage, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -188,122 +178,163 @@ 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) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), filter, this.client.getApiVersion(), useMarkupIfPartner, + previewMarkupPercentage, billingAccountId, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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( - String billingAccountId, String billingProfileId, String filter) { + private Mono> + listByBillingProfileSinglePageAsync(String billingAccountId, String billingProfileId, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -315,50 +346,39 @@ private Mono> listByBillingProf } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByBillingProfile( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - billingAccountId, - billingProfileId, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByBillingProfile(this.client.getEndpoint(), filter, + this.client.getApiVersion(), billingAccountId, billingProfileId, 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())); } /** - * 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( String billingAccountId, String billingProfileId, String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (billingAccountId == null) { return Mono @@ -371,129 +391,143 @@ private Mono> listByBillingProf final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByBillingProfile( - this.client.getEndpoint(), - filter, - this.client.getApiVersion(), - billingAccountId, - billingProfileId, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByBillingProfile(this.client.getEndpoint(), filter, this.client.getApiVersion(), billingAccountId, + billingProfileId, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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( - String billingAccountId, String billingProfileId, String filter) { - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, filter), + private PagedFlux listByBillingProfileAsync(String billingAccountId, + String billingProfileId, String filter) { + return new PagedFlux<>(() -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, filter), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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( - String billingAccountId, String billingProfileId) { + private PagedFlux listByBillingProfileAsync(String billingAccountId, + String billingProfileId) { final String filter = null; - return new PagedFlux<>( - () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, filter), + return new PagedFlux<>(() -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, filter), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink)); } /** - * 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( - String billingAccountId, String billingProfileId, String filter, Context context) { + private PagedFlux listByBillingProfileAsync(String billingAccountId, + String billingProfileId, String filter, Context context) { return new PagedFlux<>( () -> listByBillingProfileSinglePageAsync(billingAccountId, billingProfileId, filter, context), nextLink -> listByBillingProfileNextSinglePageAsync(nextLink, 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 ManagementException thrown if 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( - String billingAccountId, String billingProfileId) { + public PagedIterable listByBillingProfile(String billingAccountId, + String billingProfileId) { final String filter = null; return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, filter)); } /** - * 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( - String billingAccountId, String billingProfileId, String filter, Context context) { + public PagedIterable listByBillingProfile(String billingAccountId, + String billingProfileId, String filter, Context context) { return new PagedIterable<>(listByBillingProfileAsync(billingAccountId, billingProfileId, 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) { @@ -501,35 +535,28 @@ private Mono> listNextSinglePageAsync 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -537,97 +564,74 @@ private Mono> listNextSinglePageAsync 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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( - String nextLink) { + private Mono> + listByBillingProfileNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> + listByBillingProfileNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByBillingProfileNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationTransactionsImpl.java index b91b2303ad4b..adba53ccc7a5 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,17 +13,16 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ReservationTransactionsImpl( - ReservationTransactionsClient innerClient, + public ReservationTransactionsImpl(ReservationTransactionsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -31,26 +30,30 @@ public ReservationTransactionsImpl( public PagedIterable list(String billingAccountId) { PagedIterable inner = this.serviceClient().list(billingAccountId); - return Utils.mapPage(inner, inner1 -> new ReservationTransactionImpl(inner1, this.manager())); + return ResourceManagerUtils.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); - return Utils.mapPage(inner, inner1 -> new ReservationTransactionImpl(inner1, this.manager())); + public PagedIterable list(String billingAccountId, String filter, + Boolean useMarkupIfPartner, BigDecimal previewMarkupPercentage, Context context) { + PagedIterable inner + = this.serviceClient().list(billingAccountId, filter, useMarkupIfPartner, previewMarkupPercentage, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationTransactionImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); - return Utils.mapPage(inner, inner1 -> new ModernReservationTransactionImpl(inner1, this.manager())); + public PagedIterable listByBillingProfile(String billingAccountId, + String billingProfileId) { + PagedIterable inner + = this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ModernReservationTransactionImpl(inner1, this.manager())); } - public PagedIterable listByBillingProfile( - String billingAccountId, String billingProfileId, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, filter, context); - return Utils.mapPage(inner, inner1 -> new ModernReservationTransactionImpl(inner1, this.manager())); + public PagedIterable listByBillingProfile(String billingAccountId, + String billingProfileId, String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByBillingProfile(billingAccountId, billingProfileId, filter, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new ModernReservationTransactionImpl(inner1, this.manager())); } private ReservationTransactionsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsClientImpl.java index 405601530680..d49a40599ecd 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,30 +25,33 @@ 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; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ReservationsDetailsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ReservationsDetailsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ReservationsDetailsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReservationsDetailsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(ReservationsDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ReservationsDetailsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -58,102 +61,82 @@ public final class ReservationsDetailsClientImpl implements ReservationsDetailsC */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationsDetailsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption" - + "/reservationDetails") - @ExpectedResponses({200}) + public interface ReservationsDetailsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationDetails") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReservationOrder( - @HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}" - + "/providers/Microsoft.Consumption/reservationDetails") - @ExpectedResponses({200}) + Mono> listByReservationOrder(@HostParam("$host") String endpoint, + @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationDetails") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservation( - @HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationDetails") - @ExpectedResponses({200}) + @HostParam("$host") String endpoint, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @QueryParam("$filter") String filter, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationDetails") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @QueryParam("$filter") String filter, - @QueryParam("reservationId") String reservationId, - @QueryParam("reservationOrderId") String reservationOrderId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) + Mono> list(@HostParam("$host") String endpoint, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, + @QueryParam("startDate") String startDate, @QueryParam("endDate") String endDate, + @QueryParam("$filter") String filter, @QueryParam("reservationId") String reservationId, + @QueryParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, 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 filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String reservationOrderId, String filter) { + private Mono> listByReservationOrderSinglePageAsync(String reservationOrderId, + String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -164,48 +147,36 @@ private Mono> listByReservationOrderSingle } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByReservationOrder( - this.client.getEndpoint(), - reservationOrderId, - filter, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrder(this.client.getEndpoint(), reservationOrderId, + filter, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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> listByReservationOrderSinglePageAsync( - String reservationOrderId, String filter, Context context) { + private Mono> listByReservationOrderSinglePageAsync(String reservationOrderId, + String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -217,67 +188,70 @@ private Mono> listByReservationOrderSingle final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByReservationOrder( - this.client.getEndpoint(), reservationOrderId, filter, this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByReservationOrder(this.client.getEndpoint(), reservationOrderId, filter, this.client.getApiVersion(), + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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) { - return new PagedFlux<>( - () -> listByReservationOrderSinglePageAsync(reservationOrderId, filter), + return new PagedFlux<>(() -> listByReservationOrderSinglePageAsync(reservationOrderId, filter), nextLink -> listByReservationOrderNextSinglePageAsync(nextLink)); } /** - * 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReservationOrderAsync( - String reservationOrderId, String filter, Context context) { - return new PagedFlux<>( - () -> listByReservationOrderSinglePageAsync(reservationOrderId, filter, context), + private PagedFlux listByReservationOrderAsync(String reservationOrderId, String filter, + Context context) { + return new PagedFlux<>(() -> listByReservationOrderSinglePageAsync(reservationOrderId, filter, context), nextLink -> listByReservationOrderNextSinglePageAsync(nextLink, 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 filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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,43 +259,50 @@ 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReservationOrder( - String reservationOrderId, String filter, Context context) { + public PagedIterable listByReservationOrder(String reservationOrderId, String filter, + Context context) { return new PagedIterable<>(listByReservationOrderAsync(reservationOrderId, filter, 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( String reservationOrderId, String reservationId, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -335,50 +316,37 @@ private Mono> listByReservationOrderAndRes } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByReservationOrderAndReservation( - this.client.getEndpoint(), - reservationOrderId, - reservationId, - filter, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrderAndReservation(this.client.getEndpoint(), + reservationOrderId, reservationId, filter, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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> listByReservationOrderAndReservationSinglePageAsync( String reservationOrderId, String reservationId, String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -393,391 +361,359 @@ private Mono> listByReservationOrderAndRes final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByReservationOrderAndReservation( - this.client.getEndpoint(), - reservationOrderId, - reservationId, - filter, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByReservationOrderAndReservation(this.client.getEndpoint(), reservationOrderId, reservationId, filter, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String reservationOrderId, String reservationId, String filter) { + private PagedFlux listByReservationOrderAndReservationAsync(String reservationOrderId, + String reservationId, String filter) { return new PagedFlux<>( () -> listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, reservationId, filter), nextLink -> listByReservationOrderAndReservationNextSinglePageAsync(nextLink)); } /** - * 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReservationOrderAndReservationAsync( - String reservationOrderId, String reservationId, String filter, Context context) { - return new PagedFlux<>( - () -> - listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, reservationId, filter, context), + private PagedFlux listByReservationOrderAndReservationAsync(String reservationOrderId, + String reservationId, String filter, Context context) { + return new PagedFlux<>(() -> listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, + reservationId, filter, context), nextLink -> listByReservationOrderAndReservationNextSinglePageAsync(nextLink, 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String reservationOrderId, String reservationId, String filter) { + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter) { return new PagedIterable<>( listByReservationOrderAndReservationAsync(reservationOrderId, reservationId, 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, String filter, Context context) { + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter, Context context) { return new PagedIterable<>( listByReservationOrderAndReservationAsync(reservationOrderId, reservationId, filter, context)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope 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). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId) { + private Mono> listSinglePageAsync(String resourceScope, String startDate, + String endDate, String filter, String reservationId, String reservationOrderId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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(), - scope, - startDate, - endDate, - filter, - reservationId, - reservationOrderId, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), resourceScope, startDate, endDate, filter, + reservationId, reservationOrderId, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope 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). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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> listSinglePageAsync( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { + private Mono> listSinglePageAsync(String resourceScope, String startDate, + String endDate, String filter, String reservationId, String reservationOrderId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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(), - scope, - startDate, - endDate, - filter, - reservationId, - reservationOrderId, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), resourceScope, startDate, endDate, filter, reservationId, + reservationOrderId, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope 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). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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 startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId) { + private PagedFlux listAsync(String resourceScope, String startDate, String endDate, + String filter, String reservationId, String reservationOrderId) { return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId), + () -> listSinglePageAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing reservation details. + * @return result of listing reservation details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String scope) { + private PagedFlux listAsync(String resourceScope) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId), + () -> listSinglePageAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceScope, String startDate, String endDate, + String filter, String reservationId, String reservationOrderId, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceScope, startDate, endDate, filter, reservationId, + reservationOrderId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String scope) { + public PagedIterable list(String resourceScope) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; - return new PagedIterable<>(listAsync(scope, startDate, endDate, filter, reservationId, reservationOrderId)); + return new PagedIterable<>( + listAsync(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId)); } /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { + public PagedIterable list(String resourceScope, String startDate, String endDate, + String filter, String reservationId, 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) { @@ -785,148 +721,120 @@ private Mono> listByReservationOrderNextSi 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.")); + 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.listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByReservationOrderNextSinglePageAsync(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.")); + 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 - .listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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( - String nextLink) { + private Mono> + listByReservationOrderAndReservationNextSinglePageAsync(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.")); + 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 - .listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrderAndReservationNext(nextLink, + this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> + listByReservationOrderAndReservationNextSinglePageAsync(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.")); + 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 - .listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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) { @@ -934,35 +842,28 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -970,23 +871,13 @@ private Mono> listNextSinglePageAsync(Stri 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsDetailsImpl.java index baf24d702654..9f70d32c3235 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,67 +11,57 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ReservationsDetailsImpl( - ReservationsDetailsClient innerClient, + public ReservationsDetailsImpl(ReservationsDetailsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByReservationOrder(String reservationOrderId, String filter) { - PagedIterable inner = - this.serviceClient().listByReservationOrder(reservationOrderId, filter); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByReservationOrder(reservationOrderId, filter); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrder( - String reservationOrderId, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByReservationOrder(reservationOrderId, filter, context); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + public PagedIterable listByReservationOrder(String reservationOrderId, String filter, + Context context) { + PagedIterable inner + = this.serviceClient().listByReservationOrder(reservationOrderId, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, String filter) { - PagedIterable inner = - this.serviceClient().listByReservationOrderAndReservation(reservationOrderId, reservationId, filter); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter) { + PagedIterable inner + = this.serviceClient().listByReservationOrderAndReservation(reservationOrderId, reservationId, filter); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, String filter, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByReservationOrderAndReservation(reservationOrderId, reservationId, filter, context); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter, Context context) { + PagedIterable inner = this.serviceClient() + .listByReservationOrderAndReservation(reservationOrderId, reservationId, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable list(String scope) { - PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope) { + PagedIterable inner = this.serviceClient().list(resourceScope); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } - public PagedIterable list( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { - PagedIterable inner = - this.serviceClient().list(scope, startDate, endDate, filter, reservationId, reservationOrderId, context); - return Utils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope, String startDate, String endDate, String filter, + String reservationId, String reservationOrderId, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceScope, startDate, endDate, filter, reservationId, reservationOrderId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationDetailImpl(inner1, this.manager())); } private ReservationsDetailsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesClientImpl.java index 18b19328a4ed..a9e078a75894 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,32 +25,34 @@ 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; import com.azure.resourcemanager.consumption.models.ReservationSummariesListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in ReservationsSummariesClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final ReservationsSummariesService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of ReservationsSummariesClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ ReservationsSummariesClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy - .create(ReservationsSummariesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service = RestProxy.create(ReservationsSummariesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); this.client = client; } @@ -60,106 +62,84 @@ public final class ReservationsSummariesClientImpl implements ReservationsSummar */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface ReservationsSummariesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption" - + "/reservationSummaries") - @ExpectedResponses({200}) + public interface ReservationsSummariesService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/providers/Microsoft.Consumption/reservationSummaries") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByReservationOrder( - @HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @QueryParam("grain") Datagrain grain, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}" - + "/providers/Microsoft.Consumption/reservationSummaries") - @ExpectedResponses({200}) + Mono> listByReservationOrder(@HostParam("$host") String endpoint, + @PathParam("reservationOrderId") String reservationOrderId, @QueryParam("grain") Datagrain grain, + @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Capacity/reservationorders/{reservationOrderId}/reservations/{reservationId}/providers/Microsoft.Consumption/reservationSummaries") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservation( - @HostParam("$host") String endpoint, - @PathParam("reservationOrderId") String reservationOrderId, - @PathParam("reservationId") String reservationId, - @QueryParam("grain") Datagrain grain, - @QueryParam("$filter") String filter, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/{scope}/providers/Microsoft.Consumption/reservationSummaries") - @ExpectedResponses({200}) + @HostParam("$host") String endpoint, @PathParam("reservationOrderId") String reservationOrderId, + @PathParam("reservationId") String reservationId, @QueryParam("grain") Datagrain grain, + @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/{resourceScope}/providers/Microsoft.Consumption/reservationSummaries") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("grain") Datagrain grain, - @QueryParam("startDate") String startDate, - @QueryParam("endDate") String endDate, - @QueryParam("$filter") String filter, + Mono> list(@HostParam("$host") String endpoint, + @PathParam(value = "resourceScope", encoded = true) String resourceScope, + @QueryParam("grain") Datagrain grain, @QueryParam("startDate") String startDate, + @QueryParam("endDate") String endDate, @QueryParam("$filter") String filter, @QueryParam("reservationId") String reservationId, - @QueryParam("reservationOrderId") String reservationOrderId, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + @QueryParam("reservationOrderId") String reservationOrderId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByReservationOrderAndReservationNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, 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 grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String reservationOrderId, Datagrain grain, String filter) { + private Mono> + listByReservationOrderSinglePageAsync(String reservationOrderId, Datagrain grain, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -170,50 +150,35 @@ private Mono> listByReservationOrderSingl } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByReservationOrder( - this.client.getEndpoint(), - reservationOrderId, - grain, - filter, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrder(this.client.getEndpoint(), reservationOrderId, grain, + filter, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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> listByReservationOrderSinglePageAsync( String reservationOrderId, Datagrain grain, String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -225,93 +190,85 @@ private Mono> listByReservationOrderSingl final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByReservationOrder( - this.client.getEndpoint(), - reservationOrderId, - grain, - filter, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByReservationOrder(this.client.getEndpoint(), reservationOrderId, grain, filter, + this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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, String filter) { - return new PagedFlux<>( - () -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter), + private PagedFlux listByReservationOrderAsync(String reservationOrderId, Datagrain grain, + String filter) { + return new PagedFlux<>(() -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter), nextLink -> listByReservationOrderNextSinglePageAsync(nextLink)); } /** - * 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) { final String filter = null; - return new PagedFlux<>( - () -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter), + return new PagedFlux<>(() -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter), nextLink -> listByReservationOrderNextSinglePageAsync(nextLink)); } /** - * 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReservationOrderAsync( - String reservationOrderId, Datagrain grain, String filter, Context context) { - return new PagedFlux<>( - () -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter, context), + private PagedFlux listByReservationOrderAsync(String reservationOrderId, Datagrain grain, + String filter, Context context) { + return new PagedFlux<>(() -> listByReservationOrderSinglePageAsync(reservationOrderId, grain, filter, context), nextLink -> listByReservationOrderNextSinglePageAsync(nextLink, 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 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,45 +277,48 @@ 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReservationOrder( - String reservationOrderId, Datagrain grain, String filter, Context context) { + public PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain, + String filter, Context context) { return new PagedIterable<>(listByReservationOrderAsync(reservationOrderId, grain, filter, 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( String reservationOrderId, String reservationId, Datagrain grain, String filter) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -372,52 +332,36 @@ private Mono> listByReservationOrderAndRe } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByReservationOrderAndReservation( - this.client.getEndpoint(), - reservationOrderId, - reservationId, - grain, - filter, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrderAndReservation(this.client.getEndpoint(), + reservationOrderId, reservationId, grain, filter, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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> listByReservationOrderAndReservationSinglePageAsync( String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (reservationOrderId == null) { return Mono @@ -432,61 +376,51 @@ private Mono> listByReservationOrderAndRe final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByReservationOrderAndReservation( - this.client.getEndpoint(), - reservationOrderId, - reservationId, - grain, - filter, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByReservationOrderAndReservation(this.client.getEndpoint(), reservationOrderId, reservationId, grain, + filter, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String reservationOrderId, String reservationId, Datagrain grain, String filter) { + private PagedFlux listByReservationOrderAndReservationAsync(String reservationOrderId, + String reservationId, Datagrain grain, String filter) { return new PagedFlux<>( () -> listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, reservationId, grain, filter), nextLink -> listByReservationOrderAndReservationNextSinglePageAsync(nextLink)); } /** - * 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. * @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 listByReservationOrderAndReservationAsync( - String reservationOrderId, String reservationId, Datagrain grain) { + private PagedFlux listByReservationOrderAndReservationAsync(String reservationOrderId, + String reservationId, Datagrain grain) { final String filter = null; return new PagedFlux<>( () -> listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, reservationId, grain, filter), @@ -494,180 +428,154 @@ 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByReservationOrderAndReservationAsync( - String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context) { - return new PagedFlux<>( - () -> - listByReservationOrderAndReservationSinglePageAsync( - reservationOrderId, reservationId, grain, filter, context), + private PagedFlux listByReservationOrderAndReservationAsync(String reservationOrderId, + String reservationId, Datagrain grain, String filter, Context context) { + return new PagedFlux<>(() -> listByReservationOrderAndReservationSinglePageAsync(reservationOrderId, + reservationId, grain, filter, context), nextLink -> listByReservationOrderAndReservationNextSinglePageAsync(nextLink, 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. * @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 listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain) { + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain) { final String filter = null; return new PagedIterable<>( listByReservationOrderAndReservationAsync(reservationOrderId, reservationId, grain, filter)); } /** - * 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context) { + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain, String filter, Context context) { return new PagedIterable<>( listByReservationOrderAndReservationAsync(reservationOrderId, reservationId, grain, filter, context)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope 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). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId) { + private Mono> listSinglePageAsync(String resourceScope, Datagrain grain, + String startDate, String endDate, String filter, String reservationId, String reservationOrderId) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } if (grain == null) { return Mono.error(new IllegalArgumentException("Parameter grain is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - scope, - grain, - startDate, - endDate, - filter, - reservationId, - reservationOrderId, - this.client.getApiVersion(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), resourceScope, grain, startDate, endDate, + filter, reservationId, reservationOrderId, this.client.getApiVersion(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope 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). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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> listSinglePageAsync( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, + private Mono> listSinglePageAsync(String resourceScope, Datagrain grain, + String startDate, String endDate, String filter, String reservationId, String reservationOrderId, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } if (grain == null) { return Mono.error(new IllegalArgumentException("Parameter grain is required and cannot be null.")); @@ -675,196 +583,167 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - scope, - grain, - startDate, - endDate, - filter, - reservationId, - reservationOrderId, - this.client.getApiVersion(), - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), resourceScope, grain, startDate, endDate, filter, reservationId, + reservationOrderId, this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope 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). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId), - nextLink -> listNextSinglePageAsync(nextLink)); + private PagedFlux listAsync(String resourceScope, Datagrain grain, String startDate, + String endDate, String filter, String reservationId, String reservationOrderId) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceScope, grain, startDate, endDate, filter, + reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @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 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), - nextLink -> listNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(resourceScope, grain, startDate, endDate, filter, + reservationId, reservationOrderId), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - scope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + private PagedFlux listAsync(String resourceScope, Datagrain grain, String startDate, + String endDate, String filter, String reservationId, String reservationOrderId, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceScope, grain, startDate, endDate, filter, + reservationId, reservationOrderId, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @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 list(String scope, Datagrain grain) { + public PagedIterable list(String resourceScope, Datagrain grain) { final String startDate = null; final String endDate = null; final String filter = null; final String reservationId = null; final String reservationOrderId = null; return new PagedIterable<>( - listAsync(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId)); + listAsync(resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId)); } /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { + public PagedIterable list(String resourceScope, Datagrain grain, String startDate, + String endDate, String filter, String reservationId, 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) { @@ -872,148 +751,120 @@ private Mono> listByReservationOrderNextS 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.")); + 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.listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> listByReservationOrderNextSinglePageAsync(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.")); + 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 - .listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByReservationOrderNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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( - String nextLink) { + private Mono> + listByReservationOrderAndReservationNextSinglePageAsync(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.")); + 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 - .listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByReservationOrderAndReservationNext(nextLink, + this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @param 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( - String nextLink, Context context) { + private Mono> + listByReservationOrderAndReservationNextSinglePageAsync(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.")); + 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 - .listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByReservationOrderAndReservationNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * - * @param nextLink The nextLink parameter. + * + * @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) { @@ -1021,35 +872,28 @@ private Mono> listNextSinglePageAsync(Str 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -1057,23 +901,13 @@ private Mono> listNextSinglePageAsync(Str 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ReservationsSummariesImpl.java index 05a85e5bf233..a1695b37154a 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 @@ -10,72 +10,59 @@ import com.azure.resourcemanager.consumption.fluent.ReservationsSummariesClient; import com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner; 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; +import com.azure.resourcemanager.consumption.models.ReservationSummary; 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public ReservationsSummariesImpl( - ReservationsSummariesClient innerClient, + public ReservationsSummariesImpl(ReservationsSummariesClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain) { - PagedIterable inner = - this.serviceClient().listByReservationOrder(reservationOrderId, grain); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + PagedIterable inner + = this.serviceClient().listByReservationOrder(reservationOrderId, grain); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrder( - String reservationOrderId, Datagrain grain, String filter, Context context) { - PagedIterable inner = - this.serviceClient().listByReservationOrder(reservationOrderId, grain, filter, context); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + public PagedIterable listByReservationOrder(String reservationOrderId, Datagrain grain, + String filter, Context context) { + PagedIterable inner + = this.serviceClient().listByReservationOrder(reservationOrderId, grain, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain) { - PagedIterable inner = - this.serviceClient().listByReservationOrderAndReservation(reservationOrderId, reservationId, grain); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain) { + PagedIterable inner + = this.serviceClient().listByReservationOrderAndReservation(reservationOrderId, reservationId, grain); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain, String filter, Context context) { - PagedIterable inner = - this - .serviceClient() - .listByReservationOrderAndReservation(reservationOrderId, reservationId, grain, filter, context); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + public PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain, String filter, Context context) { + PagedIterable inner = this.serviceClient() + .listByReservationOrderAndReservation(reservationOrderId, reservationId, grain, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable list(String scope, Datagrain grain) { - PagedIterable inner = this.serviceClient().list(scope, grain); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope, Datagrain grain) { + PagedIterable inner = this.serviceClient().list(resourceScope, grain); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } - public PagedIterable list( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list(scope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context); - return Utils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); + public PagedIterable list(String resourceScope, Datagrain grain, String startDate, + String endDate, String filter, String reservationId, String reservationOrderId, Context context) { + PagedIterable inner = this.serviceClient() + .list(resourceScope, grain, startDate, endDate, filter, reservationId, reservationOrderId, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new ReservationSummaryImpl(inner1, this.manager())); } private ReservationsSummariesClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/Utils.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ResourceManagerUtils.java similarity index 79% rename from sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/Utils.java rename to sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ResourceManagerUtils.java index cfb65eed5059..8a01379a8b21 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/Utils.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -60,7 +63,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -74,7 +77,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +87,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +127,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +189,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsClientImpl.java index 67df95a5b218..aded0ff9a178 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,24 +21,27 @@ 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. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final TagsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of TagsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ TagsClientImpl(ConsumptionManagementClientImpl client) { @@ -52,42 +55,37 @@ public final class TagsClientImpl implements TagsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface TagsService { - @Headers({"Content-Type: application/json"}) + public interface TagsService { + @Headers({ "Content-Type: application/json" }) @Get("/{scope}/providers/Microsoft.Consumption/tags") - @ExpectedResponses({200, 204}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @HostParam("$host") String endpoint, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group 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) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -101,28 +99,26 @@ private Mono> getWithResponseAsync(String scope) { /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * 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} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String scope, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -134,73 +130,62 @@ private Mono> getWithResponseAsync(String scope, Conte /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group 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 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())); } /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * 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(); } /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * 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. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group 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. */ @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 66f604cb115e..254dd17c1de1 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,23 +25,20 @@ public TagsImpl(TagsClient innerClient, com.azure.resourcemanager.consumption.Co this.serviceManager = serviceManager; } - public TagsResult get(String scope) { - TagsResultInner inner = this.serviceClient().get(scope); + public Response getWithResponse(String scope, Context context) { + Response inner = this.serviceClient().getWithResponse(scope, context); if (inner != null) { - return new TagsResultImpl(inner, this.manager()); + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new TagsResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public Response getWithResponse(String scope, Context context) { - Response inner = this.serviceClient().getWithResponse(scope, context); + public TagsResult get(String scope) { + TagsResultInner inner = this.serviceClient().get(scope); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TagsResultImpl(inner.getValue(), this.manager())); + return new TagsResultImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java index 684410f228bf..25bfa0dc68e7 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/TagsResultImpl.java @@ -15,8 +15,8 @@ public final class TagsResultImpl implements TagsResult { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - TagsResultImpl( - TagsResultInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + TagsResultImpl(TagsResultInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailImpl.java index b3c50f35bd85..dc82c209ada0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailImpl.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailImpl.java @@ -6,6 +6,7 @@ import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import com.azure.resourcemanager.consumption.models.UsageDetail; +import com.azure.resourcemanager.consumption.models.UsageDetailsKind; import java.util.Collections; import java.util.Map; @@ -14,8 +15,8 @@ public final class UsageDetailImpl implements UsageDetail { private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - UsageDetailImpl( - UsageDetailInner innerObject, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + UsageDetailImpl(UsageDetailInner innerObject, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -32,6 +33,10 @@ public String type() { return this.innerModel().type(); } + public UsageDetailsKind kind() { + return this.innerModel().kind(); + } + public String etag() { return this.innerModel().etag(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsClientImpl.java index 44a113317cd0..a8d6b0169479 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,31 +25,34 @@ 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; import com.azure.resourcemanager.consumption.models.UsageDetailsListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in UsageDetailsClient. */ +/** + * 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. */ + /** + * The proxy service used to perform REST calls. + */ private final UsageDetailsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final ConsumptionManagementClientImpl client; /** * Initializes an instance of UsageDetailsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ UsageDetailsClientImpl(ConsumptionManagementClientImpl client) { - this.service = - RestProxy.create(UsageDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(UsageDetailsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } @@ -59,159 +62,139 @@ public final class UsageDetailsClientImpl implements UsageDetailsClient { */ @Host("{$host}") @ServiceInterface(name = "ConsumptionManagemen") - private interface UsageDetailsService { - @Headers({"Content-Type: application/json"}) + 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, - @PathParam(value = "scope", encoded = true) String scope, - @QueryParam("$expand") String expand, - @QueryParam("$filter") String filter, - @QueryParam("$skiptoken") String skiptoken, - @QueryParam("$top") Integer top, - @QueryParam("api-version") String apiVersion, - @QueryParam("metric") Metrictype metric, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @PathParam(value = "scope", encoded = true) String scope, @QueryParam("$expand") String expand, + @QueryParam("$filter") String filter, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion, + @QueryParam("metric") Metrictype metric, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric) { + private Mono> listSinglePageAsync(String scope, String expand, String filter, + String skiptoken, Integer top, Metrictype metric) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - scope, - expand, - filter, - skiptoken, - top, - this.client.getApiVersion(), - metric, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), scope, expand, filter, skiptoken, top, + this.client.getApiVersion(), metric, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Lists the 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @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> listSinglePageAsync( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context) { + private Mono> listSinglePageAsync(String scope, String expand, String filter, + String skiptoken, Integer top, Metrictype metric, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be 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.")); @@ -219,99 +202,92 @@ private Mono> listSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - scope, - expand, - filter, - skiptoken, - top, - this.client.getApiVersion(), - metric, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .list(this.client.getEndpoint(), scope, expand, filter, skiptoken, top, this.client.getApiVersion(), metric, + accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if 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, String expand, String filter, String skiptoken, Integer top, Metrictype metric) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric), + private PagedFlux listAsync(String scope, String expand, String filter, String skiptoken, + Integer top, Metrictype metric) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric), nextLink -> listNextSinglePageAsync(nextLink)); } /** * 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -320,83 +296,91 @@ private PagedFlux listAsync(String scope) { final String skiptoken = null; final Integer top = null; final Metrictype metric = null; - return new PagedFlux<>( - () -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric), + return new PagedFlux<>(() -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric), nextLink -> listNextSinglePageAsync(nextLink)); } /** * 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @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 as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric, context), + private PagedFlux listAsync(String scope, String expand, String filter, String skiptoken, + Integer top, Metrictype metric, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(scope, expand, filter, skiptoken, top, metric, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -411,56 +395,64 @@ 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @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 as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context) { + public PagedIterable list(String scope, String expand, String filter, String skiptoken, + Integer top, Metrictype metric, Context context) { return new PagedIterable<>(listAsync(scope, expand, filter, skiptoken, top, metric, 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 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) { @@ -468,35 +460,28 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * - * @param nextLink The 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) { @@ -504,23 +489,13 @@ private Mono> listNextSinglePageAsync(String nex 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/UsageDetailsImpl.java index 0a2f97c4b4a8..872d17557a13 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,31 +12,30 @@ 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; private final com.azure.resourcemanager.consumption.ConsumptionManager serviceManager; - public UsageDetailsImpl( - UsageDetailsClient innerClient, com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { + public UsageDetailsImpl(UsageDetailsClient innerClient, + com.azure.resourcemanager.consumption.ConsumptionManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); - return Utils.mapPage(inner, inner1 -> new UsageDetailImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageDetailImpl(inner1, this.manager())); } - public PagedIterable list( - String scope, String expand, String filter, String skiptoken, Integer top, Metrictype metric, Context context) { - PagedIterable inner = - this.serviceClient().list(scope, expand, filter, skiptoken, top, metric, context); - return Utils.mapPage(inner, inner1 -> new UsageDetailImpl(inner1, this.manager())); + public PagedIterable list(String scope, String expand, String filter, String skiptoken, Integer top, + Metrictype metric, Context context) { + PagedIterable inner + = this.serviceClient().list(scope, expand, filter, skiptoken, top, metric, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new UsageDetailImpl(inner1, this.manager())); } private UsageDetailsClient serviceClient() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/package-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/package-info.java index 7ba4ef7a2b53..db24f6cbabb3 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/package-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/implementation/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for ConsumptionManagementClient. Consumption management client provides access - * to consumption resources for Azure Enterprise Subscriptions. + * Package containing the implementations for ConsumptionManagementClient. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.consumption.implementation; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AggregatedCosts.java index 4f6201d53e82..1e472dcd3ad0 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 @@ -7,59 +7,61 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of AggregatedCosts. */ +/** + * Resource collection API of AggregatedCosts. + */ 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 ee8a60d5cd91..37a3f80dd2b9 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,14 @@ 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 . */ +/** + * The amount plus currency . + */ @Immutable public class Amount { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Amount.class); - /* * Amount currency. */ @@ -27,9 +25,15 @@ 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. - * + * * @return the currency value. */ public String currency() { @@ -38,7 +42,7 @@ public String currency() { /** * Get the value property: Amount. - * + * * @return the value value. */ public BigDecimal value() { @@ -47,7 +51,7 @@ public BigDecimal value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/AmountWithExchangeRate.java index 56359257ad74..d144ce9feb34 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,14 @@ 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. */ +/** + * 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,9 +25,15 @@ 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. - * + * * @return the exchangeRate value. */ public BigDecimal exchangeRate() { @@ -38,7 +42,7 @@ public BigDecimal exchangeRate() { /** * Get the exchangeRateMonth property: The exchange rate month. - * + * * @return the exchangeRateMonth value. */ public Integer exchangeRateMonth() { @@ -47,7 +51,7 @@ public Integer exchangeRateMonth() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override 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 05ffe918298a..20cae102175d 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 @@ -9,53 +9,55 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of Balance. */ +/** + * An immutable client-side representation of Balance. + */ public interface Balance { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ String currency(); /** * Gets the beginningBalance property: The beginning balance for the billing period. - * + * * @return the beginningBalance value. */ BigDecimal beginningBalance(); @@ -63,98 +65,105 @@ public interface Balance { /** * Gets the endingBalance property: The ending balance for the billing period (for open periods this will be updated * daily). - * + * * @return the endingBalance value. */ BigDecimal endingBalance(); /** * Gets the newPurchases property: Total new purchase amount. - * + * * @return the newPurchases value. */ BigDecimal newPurchases(); /** * Gets the adjustments property: Total adjustment amount. - * + * * @return the adjustments value. */ BigDecimal adjustments(); /** * Gets the utilized property: Total Commitment usage. - * + * * @return the utilized value. */ BigDecimal utilized(); /** * Gets the serviceOverage property: Overage for Azure services. - * + * * @return the serviceOverage value. */ BigDecimal serviceOverage(); /** * Gets the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ BigDecimal chargesBilledSeparately(); /** * Gets the totalOverage property: serviceOverage + chargesBilledSeparately. - * + * * @return the totalOverage value. */ BigDecimal totalOverage(); /** * Gets the totalUsage property: Azure service commitment + total Overage. - * + * * @return the totalUsage value. */ BigDecimal totalUsage(); /** * Gets the azureMarketplaceServiceCharges property: Total charges for Azure Marketplace. - * + * * @return the azureMarketplaceServiceCharges value. */ BigDecimal azureMarketplaceServiceCharges(); /** * Gets the billingFrequency property: The billing frequency. - * + * * @return the billingFrequency value. */ BillingFrequency billingFrequency(); /** * Gets the priceHidden property: Price is hidden or not. - * + * * @return the priceHidden value. */ Boolean priceHidden(); + /** + * Gets the overageRefund property: Overage Refunds. + * + * @return the overageRefund value. + */ + BigDecimal overageRefund(); + /** * Gets the newPurchasesDetails property: List of new purchases. - * + * * @return the newPurchasesDetails value. */ List newPurchasesDetails(); /** * Gets the adjustmentDetails property: List of Adjustments (Promo credit, SIE credit etc.). - * + * * @return the adjustmentDetails value. */ List adjustmentDetails(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.BalanceInner object. - * + * * @return the inner object. */ BalanceInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesAdjustmentDetailsItem.java index 28b35f39200b..6a11c0ea8958 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,14 @@ 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. */ +/** + * The BalancePropertiesAdjustmentDetailsItem model. + */ @Immutable public final class BalancePropertiesAdjustmentDetailsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalancePropertiesAdjustmentDetailsItem.class); - /* * the name of new adjustment. */ @@ -27,9 +25,15 @@ 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. - * + * * @return the name value. */ public String name() { @@ -38,7 +42,7 @@ public String name() { /** * Get the value property: the value of new adjustment. - * + * * @return the value value. */ public BigDecimal value() { @@ -47,7 +51,7 @@ public BigDecimal value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BalancePropertiesNewPurchasesDetailsItem.java index 88f9ac43b8b4..8e4e6e78a573 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,14 @@ 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. */ +/** + * The BalancePropertiesNewPurchasesDetailsItem model. + */ @Immutable public final class BalancePropertiesNewPurchasesDetailsItem { - @JsonIgnore private final ClientLogger logger = new ClientLogger(BalancePropertiesNewPurchasesDetailsItem.class); - /* * the name of new purchase. */ @@ -27,9 +25,15 @@ 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. - * + * * @return the name value. */ public String name() { @@ -38,7 +42,7 @@ public String name() { /** * Get the value property: the value of new purchase. - * + * * @return the value value. */ public BigDecimal value() { @@ -47,7 +51,7 @@ public BigDecimal value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Balances.java index 285e4cd37caa..efc46b4c1b81 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 @@ -7,58 +7,60 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Balances. */ +/** + * Resource collection API of Balances. + */ public interface Balances { /** * 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. + * @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 * for May 1, 2014 or later. - * + * * @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 * for May 1, 2014 or later. - * + * * @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 9f47894ab8cb..ffeaad64ed12 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,20 +8,37 @@ 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. */ + /** + * Static value Month for BillingFrequency. + */ public static final BillingFrequency MONTH = fromString("Month"); - /** Static value Quarter for BillingFrequency. */ + /** + * Static value Quarter for BillingFrequency. + */ public static final BillingFrequency QUARTER = fromString("Quarter"); - /** Static value Year for BillingFrequency. */ + /** + * Static value Year for BillingFrequency. + */ public static final BillingFrequency YEAR = fromString("Year"); + /** + * Creates a new instance of BillingFrequency value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BillingFrequency() { + } + /** * Creates or finds a BillingFrequency from its string representation. - * + * * @param name a name to look for. * @return the corresponding BillingFrequency. */ @@ -30,7 +47,11 @@ public static BillingFrequency fromString(String name) { return fromString(name, BillingFrequency.class); } - /** @return known BillingFrequency values. */ + /** + * Gets known BillingFrequency values. + * + * @return known BillingFrequency values. + */ public static Collection values() { return values(BillingFrequency.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budget.java index 125f395964b8..c1575e5b7aad 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 @@ -9,25 +9,27 @@ import java.math.BigDecimal; import java.util.Map; -/** An immutable client-side representation of Budget. */ +/** + * An immutable client-side representation of Budget. + */ public interface Budget { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); @@ -35,21 +37,21 @@ public interface Budget { /** * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ String etag(); /** * Gets the category property: The category of the budget, whether the budget tracks cost or usage. - * + * * @return the category value. */ CategoryType category(); /** * Gets the amount property: The total amount of cost to track with the budget. - * + * * @return the amount value. */ BigDecimal amount(); @@ -57,7 +59,7 @@ public interface Budget { /** * Gets the timeGrain property: The time covered by a budget. Tracking of the amount will be reset based on the time * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. - * + * * @return the timeGrain value. */ TimeGrainType timeGrain(); @@ -67,21 +69,21 @@ public interface Budget { * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date should * not be more than twelve months. Past start date should be selected within the timegrain period. There are no * restrictions on the end date. - * + * * @return the timePeriod value. */ BudgetTimePeriod timePeriod(); /** * Gets the filter property: May be used to filter budgets by user-specified dimensions and/or tags. - * + * * @return the filter value. */ BudgetFilter filter(); /** * Gets the currentSpend property: The current amount of cost which is being tracked for a budget. - * + * * @return the currentSpend value. */ CurrentSpend currentSpend(); @@ -89,293 +91,342 @@ public interface Budget { /** * Gets the notifications property: Dictionary of notifications associated with the budget. Budget can have up to * five notifications. - * + * * @return the notifications value. */ Map notifications(); /** * Gets the forecastSpend property: The forecasted cost which is being tracked for a budget. - * + * * @return the forecastSpend value. */ ForecastSpend forecastSpend(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.BudgetInner object. - * + * * @return the inner object. */ BudgetInner innerModel(); - /** The entirety of the Budget definition. */ + /** + * The entirety of the Budget definition. + */ interface Definition extends DefinitionStages.Blank, DefinitionStages.WithScope, DefinitionStages.WithCreate { } - /** The Budget definition stages. */ + + /** + * The Budget definition stages. + */ interface DefinitionStages { - /** The first stage of the Budget definition. */ + /** + * The first stage of the Budget definition. + */ interface Blank extends WithScope { } - /** The stage of the Budget definition allowing to specify parent resource. */ + + /** + * The stage of the Budget definition allowing to specify parent resource. + */ interface WithScope { /** * Specifies scope. - * + * * @param scope The scope associated with budget operations. This includes - * '/subscriptions/{subscriptionId}/' for subscription scope, - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for - * Department scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' - * for Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' - * for billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' - * for invoiceSection scope. + * '/subscriptions/{subscriptionId}/' for subscription scope, + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for + * Department scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for + * invoiceSection scope. * @return the next definition stage. */ WithCreate withExistingScope(String scope); } + /** * The stage of the Budget definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithEtag, - DefinitionStages.WithCategory, - DefinitionStages.WithAmount, - DefinitionStages.WithTimeGrain, - DefinitionStages.WithTimePeriod, - DefinitionStages.WithFilter, - DefinitionStages.WithNotifications { + interface WithCreate extends DefinitionStages.WithEtag, DefinitionStages.WithCategory, + DefinitionStages.WithAmount, DefinitionStages.WithTimeGrain, DefinitionStages.WithTimePeriod, + DefinitionStages.WithFilter, DefinitionStages.WithNotifications { /** * Executes the create request. - * + * * @return the created resource. */ Budget create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Budget create(Context context); } - /** The stage of the Budget definition allowing to specify etag. */ + + /** + * The stage of the Budget definition allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will * be used to determine whether the user is updating the latest version or not.. - * + * * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. + * determine whether the user is updating the latest version or not. * @return the next definition stage. */ WithCreate withEtag(String etag); } - /** The stage of the Budget definition allowing to specify category. */ + + /** + * The stage of the Budget definition allowing to specify category. + */ interface WithCategory { /** * Specifies the category property: The category of the budget, whether the budget tracks cost or usage.. - * + * * @param category The category of the budget, whether the budget tracks cost or usage. * @return the next definition stage. */ WithCreate withCategory(CategoryType category); } - /** The stage of the Budget definition allowing to specify amount. */ + + /** + * The stage of the Budget definition allowing to specify amount. + */ interface WithAmount { /** * Specifies the amount property: The total amount of cost to track with the budget. - * + * * @param amount The total amount of cost to track with the budget. * @return the next definition stage. */ WithCreate withAmount(BigDecimal amount); } - /** The stage of the Budget definition allowing to specify timeGrain. */ + + /** + * The stage of the Budget definition allowing to specify timeGrain. + */ interface WithTimeGrain { /** * Specifies the timeGrain property: The time covered by a budget. Tracking of the amount will be reset * based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD * customers. - * + * * @param timeGrain The 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. + * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. * @return the next definition stage. */ WithCreate withTimeGrain(TimeGrainType timeGrain); } - /** The stage of the Budget definition allowing to specify timePeriod. */ + + /** + * The stage of the Budget definition allowing to specify timePeriod. + */ interface WithTimePeriod { /** * Specifies the timePeriod property: Has start and end date of the budget. The start date must be first of * the month and should be less than the end date. Budget start date must be on or after June 1, 2017. * Future start date should not be more than twelve months. Past start date should be selected within the * timegrain period. There are no restrictions on the end date.. - * + * * @param timePeriod 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. + * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date + * should not be more than twelve months. Past start date should be selected within the timegrain period. + * There are no restrictions on the end date. * @return the next definition stage. */ WithCreate withTimePeriod(BudgetTimePeriod timePeriod); } - /** The stage of the Budget definition allowing to specify filter. */ + + /** + * The stage of the Budget definition allowing to specify filter. + */ interface WithFilter { /** * Specifies the filter property: May be used to filter budgets by user-specified dimensions and/or tags.. - * + * * @param filter May be used to filter budgets by user-specified dimensions and/or tags. * @return the next definition stage. */ WithCreate withFilter(BudgetFilter filter); } - /** The stage of the Budget definition allowing to specify notifications. */ + + /** + * The stage of the Budget definition allowing to specify notifications. + */ interface WithNotifications { /** * Specifies the notifications property: Dictionary of notifications associated with the budget. Budget can * have up to five notifications.. - * + * * @param notifications Dictionary of notifications associated with the budget. Budget can have up to five - * notifications. + * notifications. * @return the next definition stage. */ WithCreate withNotifications(Map notifications); } } + /** * Begins update for the Budget resource. - * + * * @return the stage of resource update. */ Budget.Update update(); - /** The template for Budget update. */ + /** + * The template for Budget update. + */ interface Update - extends UpdateStages.WithEtag, - UpdateStages.WithCategory, - UpdateStages.WithAmount, - UpdateStages.WithTimeGrain, - UpdateStages.WithTimePeriod, - UpdateStages.WithFilter, - UpdateStages.WithNotifications { + extends UpdateStages.WithEtag, UpdateStages.WithCategory, UpdateStages.WithAmount, UpdateStages.WithTimeGrain, + UpdateStages.WithTimePeriod, UpdateStages.WithFilter, UpdateStages.WithNotifications { /** * Executes the update request. - * + * * @return the updated resource. */ Budget apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Budget apply(Context context); } - /** The Budget update stages. */ + + /** + * The Budget update stages. + */ interface UpdateStages { - /** The stage of the Budget update allowing to specify etag. */ + /** + * The stage of the Budget update allowing to specify etag. + */ interface WithEtag { /** * Specifies the etag property: eTag of the resource. To handle concurrent update scenario, this field will * be used to determine whether the user is updating the latest version or not.. - * + * * @param etag eTag of the resource. To handle concurrent update scenario, this field will be used to - * determine whether the user is updating the latest version or not. + * determine whether the user is updating the latest version or not. * @return the next definition stage. */ Update withEtag(String etag); } - /** The stage of the Budget update allowing to specify category. */ + + /** + * The stage of the Budget update allowing to specify category. + */ interface WithCategory { /** * Specifies the category property: The category of the budget, whether the budget tracks cost or usage.. - * + * * @param category The category of the budget, whether the budget tracks cost or usage. * @return the next definition stage. */ Update withCategory(CategoryType category); } - /** The stage of the Budget update allowing to specify amount. */ + + /** + * The stage of the Budget update allowing to specify amount. + */ interface WithAmount { /** * Specifies the amount property: The total amount of cost to track with the budget. - * + * * @param amount The total amount of cost to track with the budget. * @return the next definition stage. */ Update withAmount(BigDecimal amount); } - /** The stage of the Budget update allowing to specify timeGrain. */ + + /** + * The stage of the Budget update allowing to specify timeGrain. + */ interface WithTimeGrain { /** * Specifies the timeGrain property: The time covered by a budget. Tracking of the amount will be reset * based on the time grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD * customers. - * + * * @param timeGrain The 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. + * grain. BillingMonth, BillingQuarter, and BillingAnnual are only supported by WD customers. * @return the next definition stage. */ Update withTimeGrain(TimeGrainType timeGrain); } - /** The stage of the Budget update allowing to specify timePeriod. */ + + /** + * The stage of the Budget update allowing to specify timePeriod. + */ interface WithTimePeriod { /** * Specifies the timePeriod property: Has start and end date of the budget. The start date must be first of * the month and should be less than the end date. Budget start date must be on or after June 1, 2017. * Future start date should not be more than twelve months. Past start date should be selected within the * timegrain period. There are no restrictions on the end date.. - * + * * @param timePeriod 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. + * should be less than the end date. Budget start date must be on or after June 1, 2017. Future start date + * should not be more than twelve months. Past start date should be selected within the timegrain period. + * There are no restrictions on the end date. * @return the next definition stage. */ Update withTimePeriod(BudgetTimePeriod timePeriod); } - /** The stage of the Budget update allowing to specify filter. */ + + /** + * The stage of the Budget update allowing to specify filter. + */ interface WithFilter { /** * Specifies the filter property: May be used to filter budgets by user-specified dimensions and/or tags.. - * + * * @param filter May be used to filter budgets by user-specified dimensions and/or tags. * @return the next definition stage. */ Update withFilter(BudgetFilter filter); } - /** The stage of the Budget update allowing to specify notifications. */ + + /** + * The stage of the Budget update allowing to specify notifications. + */ interface WithNotifications { /** * Specifies the notifications property: Dictionary of notifications associated with the budget. Budget can * have up to five notifications.. - * + * * @param notifications Dictionary of notifications associated with the budget. Budget can have up to five - * notifications. + * notifications. * @return the next definition stage. */ Update withNotifications(Map notifications); } } + /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Budget refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetComparisonExpression.java index 6c4ec428fb0d..7d46cb595bf0 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,14 @@ 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. */ +/** + * 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,9 +32,15 @@ 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. - * + * * @return the name value. */ public String name() { @@ -44,7 +49,7 @@ public String name() { /** * Set the name property: The name of the column to use in comparison. - * + * * @param name the name value to set. * @return the BudgetComparisonExpression object itself. */ @@ -55,7 +60,7 @@ public BudgetComparisonExpression withName(String name) { /** * Get the operator property: The operator to use for comparison. - * + * * @return the operator value. */ public BudgetOperatorType operator() { @@ -64,7 +69,7 @@ public BudgetOperatorType operator() { /** * Set the operator property: The operator to use for comparison. - * + * * @param operator the operator value to set. * @return the BudgetComparisonExpression object itself. */ @@ -75,7 +80,7 @@ public BudgetComparisonExpression withOperator(BudgetOperatorType operator) { /** * Get the values property: Array of values to use for comparison. - * + * * @return the values value. */ public List values() { @@ -84,7 +89,7 @@ public List values() { /** * Set the values property: Array of values to use for comparison. - * + * * @param values the values value to set. * @return the BudgetComparisonExpression object itself. */ @@ -95,26 +100,26 @@ public BudgetComparisonExpression withValues(List values) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (name() == null) { - throw logger - .logExceptionAsError( + throw LOGGER.atError() + .log( new IllegalArgumentException("Missing required property name in model BudgetComparisonExpression")); } if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property operator in model BudgetComparisonExpression")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property operator in model BudgetComparisonExpression")); } if (values() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property values in model BudgetComparisonExpression")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property values in model BudgetComparisonExpression")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetComparisonExpression.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilter.java index 7af3aa43443e..401e56127771 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,20 @@ 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. */ +/** + * 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,9 +31,15 @@ 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. - * + * * @return the and value. */ public List and() { @@ -50,7 +48,7 @@ public List and() { /** * Set the and property: The logical "AND" expression. Must have at least 2 items. - * + * * @param and the and value to set. * @return the BudgetFilter object itself. */ @@ -59,29 +57,9 @@ 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. - * + * * @return the dimensions value. */ public BudgetComparisonExpression dimensions() { @@ -90,7 +68,7 @@ public BudgetComparisonExpression dimensions() { /** * Set the dimensions property: Has comparison expression for a dimension. - * + * * @param dimensions the dimensions value to set. * @return the BudgetFilter object itself. */ @@ -101,7 +79,7 @@ public BudgetFilter withDimensions(BudgetComparisonExpression dimensions) { /** * Get the tags property: Has comparison expression for a tag. - * + * * @return the tags value. */ public BudgetComparisonExpression tags() { @@ -110,7 +88,7 @@ public BudgetComparisonExpression tags() { /** * Set the tags property: Has comparison expression for a tag. - * + * * @param tags the tags value to set. * @return the BudgetFilter object itself. */ @@ -121,16 +99,13 @@ public BudgetFilter withTags(BudgetComparisonExpression tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (and() != null) { and().forEach(e -> e.validate()); } - if (not() != null) { - not().validate(); - } if (dimensions() != null) { dimensions().validate(); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetFilterProperties.java index 42ff353a3e6c..79e51b092a9e 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,13 @@ 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. */ +/** + * 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,9 +24,15 @@ 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. - * + * * @return the dimensions value. */ public BudgetComparisonExpression dimensions() { @@ -37,7 +41,7 @@ public BudgetComparisonExpression dimensions() { /** * Set the dimensions property: Has comparison expression for a dimension. - * + * * @param dimensions the dimensions value to set. * @return the BudgetFilterProperties object itself. */ @@ -48,7 +52,7 @@ public BudgetFilterProperties withDimensions(BudgetComparisonExpression dimensio /** * Get the tags property: Has comparison expression for a tag. - * + * * @return the tags value. */ public BudgetComparisonExpression tags() { @@ -57,7 +61,7 @@ public BudgetComparisonExpression tags() { /** * Set the tags property: Has comparison expression for a tag. - * + * * @param tags the tags value to set. * @return the BudgetFilterProperties object itself. */ @@ -68,7 +72,7 @@ public BudgetFilterProperties withTags(BudgetComparisonExpression tags) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetOperatorType.java index 605b90e98c05..c5023e9072aa 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,14 +8,27 @@ 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. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding BudgetOperatorType. */ @@ -24,7 +37,11 @@ public static BudgetOperatorType fromString(String name) { return fromString(name, BudgetOperatorType.class); } - /** @return known BudgetOperatorType values. */ + /** + * Gets known BudgetOperatorType values. + * + * @return known BudgetOperatorType values. + */ public static Collection values() { return values(BudgetOperatorType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetTimePeriod.java index 05a038d2a479..f7b9924f0b81 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,14 @@ 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. */ +/** + * 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,15 +21,20 @@ 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. - * + * * @return the startDate value. */ public OffsetDateTime startDate() { @@ -39,7 +43,7 @@ public OffsetDateTime startDate() { /** * Set the startDate property: The start date for the budget. - * + * * @param startDate the startDate value to set. * @return the BudgetTimePeriod object itself. */ @@ -51,7 +55,7 @@ public BudgetTimePeriod withStartDate(OffsetDateTime startDate) { /** * Get the endDate property: The end date for the budget. If not provided, we default this to 10 years from the * start date. - * + * * @return the endDate value. */ public OffsetDateTime endDate() { @@ -61,7 +65,7 @@ public OffsetDateTime endDate() { /** * Set the endDate property: The end date for the budget. If not provided, we default this to 10 years from the * start date. - * + * * @param endDate the endDate value to set. * @return the BudgetTimePeriod object itself. */ @@ -72,14 +76,15 @@ public BudgetTimePeriod withEndDate(OffsetDateTime endDate) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (startDate() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property startDate in model BudgetTimePeriod")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property startDate in model BudgetTimePeriod")); } } + + private static final ClientLogger LOGGER = new ClientLogger(BudgetTimePeriod.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Budgets.java index 30473f648fac..a5034aea4c21 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 @@ -8,172 +8,168 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Budgets. */ +/** + * Resource collection API of Budgets. + */ public interface Budgets { /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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); /** * Lists all budgets for the defined scope. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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); /** * Gets the budget for the scope by budget name. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param scope The scope associated with budget operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope, - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for - * invoiceSection scope. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope, '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope, + * '/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. - * + * * @param id the resource 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 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); /** * Gets the budget for the scope by budget name. - * + * * @param id the resource 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 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); /** * The operation to delete a budget. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -183,19 +179,19 @@ public interface Budgets { /** * The operation to delete a budget. - * + * * @param id the resource 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 response. + * @return the {@link Response}. */ Response deleteByIdWithResponse(String id, Context context); /** * Begins definition for a new Budget resource. - * + * * @param name resource name. * @return the first stage of the new Budget definition. */ diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/BudgetsListResult.java index bd33a65c2a2b..ba15f76bb2c8 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CategoryType.java index cbdbc833c36e..b19c82c944e0 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,14 +8,27 @@ 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. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding CategoryType. */ @@ -24,7 +37,11 @@ public static CategoryType fromString(String name) { return fromString(name, CategoryType.class); } - /** @return known CategoryType values. */ + /** + * Gets known CategoryType values. + * + * @return known CategoryType values. + */ public static Collection values() { return values(CategoryType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummary.java index 05d8508577ba..f611781daaa4 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,40 +6,55 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** A charge summary resource. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "kind", - defaultImpl = ChargeSummary.class) +/** + * A charge summary resource. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ChargeSummary.class, visible = true) @JsonTypeName("ChargeSummary") @JsonSubTypes({ @JsonSubTypes.Type(name = "legacy", value = LegacyChargeSummary.class), - @JsonSubTypes.Type(name = "modern", value = ModernChargeSummary.class) -}) + @JsonSubTypes.Type(name = "modern", value = ModernChargeSummary.class) }) @Fluent public class ChargeSummary extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ChargeSummary.class); + /* + * Specifies the kind of charge summary. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ChargeSummaryKind kind; /* - * 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() { + this.kind = ChargeSummaryKind.fromString("ChargeSummary"); + } + + /** + * Get the kind property: Specifies the kind of charge summary. + * + * @return the kind value. + */ + public ChargeSummaryKind kind() { + return this.kind; + } + /** * Get the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ public String etag() { @@ -49,7 +64,7 @@ public String etag() { /** * Set the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @param etag the etag value to set. * @return the ChargeSummary object itself. */ @@ -60,7 +75,7 @@ public ChargeSummary withEtag(String etag) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargeSummaryKind.java index 73c6df33f98c..cfed4dd83388 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,17 +8,32 @@ 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. */ + /** + * Static value legacy for ChargeSummaryKind. + */ public static final ChargeSummaryKind LEGACY = fromString("legacy"); - /** Static value modern for ChargeSummaryKind. */ + /** + * Static value modern for ChargeSummaryKind. + */ public static final ChargeSummaryKind MODERN = fromString("modern"); + /** + * Creates a new instance of ChargeSummaryKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ChargeSummaryKind() { + } + /** * Creates or finds a ChargeSummaryKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding ChargeSummaryKind. */ @@ -27,7 +42,11 @@ public static ChargeSummaryKind fromString(String name) { return fromString(name, ChargeSummaryKind.class); } - /** @return known ChargeSummaryKind values. */ + /** + * Gets known ChargeSummaryKind values. + * + * @return known ChargeSummaryKind values. + */ public static Collection values() { return values(ChargeSummaryKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Charges.java index 16f0b73abd97..3e97f9338da3 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 @@ -7,67 +7,67 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Charges. */ +/** + * Resource collection API of Charges. + */ public interface Charges { /** * 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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * '/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}' + * 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. + * @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. - * + * * @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}' - * 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. - * @param context The context to associate with this operation. + * '/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return result of listing 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/ChargesListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargesListResult.java index 697e150fd107..6f2aaac0e3ab 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargesListResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ChargesListResult.java @@ -7,18 +7,20 @@ import com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner; import java.util.List; -/** An immutable client-side representation of ChargesListResult. */ +/** + * An immutable client-side representation of ChargesListResult. + */ public interface ChargesListResult { /** * Gets the value property: The list of charge summary. - * + * * @return the value value. */ List value(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner object. - * + * * @return the inner object. */ ChargesListResultInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditBalanceSummary.java index 0610ce0df9c5..5b7f65f6796f 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,13 @@ 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. */ +/** + * Summary of credit balances. + */ @Immutable public final class CreditBalanceSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CreditBalanceSummary.class); - /* * Estimated balance. */ @@ -32,9 +30,15 @@ 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. - * + * * @return the estimatedBalance value. */ public Amount estimatedBalance() { @@ -43,7 +47,7 @@ public Amount estimatedBalance() { /** * Get the currentBalance property: Current balance. - * + * * @return the currentBalance value. */ public Amount currentBalance() { @@ -52,7 +56,7 @@ public Amount currentBalance() { /** * Get the estimatedBalanceInBillingCurrency property: Estimated balance in billing currency. - * + * * @return the estimatedBalanceInBillingCurrency value. */ public AmountWithExchangeRate estimatedBalanceInBillingCurrency() { @@ -61,7 +65,7 @@ public AmountWithExchangeRate estimatedBalanceInBillingCurrency() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CreditSummary.java index 8db755d5d0f4..ff3abb8aeaf2 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,104 +5,107 @@ 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. */ +/** + * An immutable client-side representation of CreditSummary. + */ public interface CreditSummary { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** - * Gets the 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. - * + * * @return the balanceSummary value. */ CreditBalanceSummary balanceSummary(); /** * Gets the pendingCreditAdjustments property: Pending credit adjustments. - * + * * @return the pendingCreditAdjustments value. */ Amount pendingCreditAdjustments(); /** * Gets the expiredCredit property: Expired credit. - * + * * @return the expiredCredit value. */ Amount expiredCredit(); /** * Gets the pendingEligibleCharges property: Pending eligible charges. - * + * * @return the pendingEligibleCharges value. */ Amount pendingEligibleCharges(); /** * Gets the creditCurrency property: The credit currency. - * + * * @return the creditCurrency value. */ String creditCurrency(); /** * Gets the billingCurrency property: The billing currency. - * + * * @return the billingCurrency value. */ String billingCurrency(); /** * Gets the reseller property: Credit's reseller. - * + * * @return the reseller value. */ Reseller reseller(); + /** + * Gets the 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. - * + * * @return the etagPropertiesEtag value. */ String etagPropertiesEtag(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner object. - * + * * @return the inner object. */ CreditSummaryInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Credits.java index c81237f13f37..8c2c077f66d7 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 @@ -7,30 +7,32 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Credits. */ +/** + * Resource collection API of Credits. + */ public interface Credits { /** * 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. + * @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 a6e0879dd012..8b0b00f26fba 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,74 +8,127 @@ 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. */ + /** + * Static value en-us for CultureCode. + */ public static final CultureCode EN_US = fromString("en-us"); - /** Static value ja-jp for CultureCode. */ + /** + * Static value ja-jp for CultureCode. + */ public static final CultureCode JA_JP = fromString("ja-jp"); - /** Static value zh-cn for CultureCode. */ + /** + * Static value zh-cn for CultureCode. + */ public static final CultureCode ZH_CN = fromString("zh-cn"); - /** Static value de-de for CultureCode. */ + /** + * Static value de-de for CultureCode. + */ public static final CultureCode DE_DE = fromString("de-de"); - /** Static value es-es for CultureCode. */ + /** + * Static value es-es for CultureCode. + */ public static final CultureCode ES_ES = fromString("es-es"); - /** Static value fr-fr for CultureCode. */ + /** + * Static value fr-fr for CultureCode. + */ public static final CultureCode FR_FR = fromString("fr-fr"); - /** Static value it-it for CultureCode. */ + /** + * Static value it-it for CultureCode. + */ public static final CultureCode IT_IT = fromString("it-it"); - /** Static value ko-kr for CultureCode. */ + /** + * Static value ko-kr for CultureCode. + */ public static final CultureCode KO_KR = fromString("ko-kr"); - /** Static value pt-br for CultureCode. */ + /** + * Static value pt-br for CultureCode. + */ public static final CultureCode PT_BR = fromString("pt-br"); - /** Static value ru-ru for CultureCode. */ + /** + * Static value ru-ru for CultureCode. + */ public static final CultureCode RU_RU = fromString("ru-ru"); - /** Static value zh-tw for CultureCode. */ + /** + * Static value zh-tw for CultureCode. + */ public static final CultureCode ZH_TW = fromString("zh-tw"); - /** Static value cs-cz for CultureCode. */ + /** + * Static value cs-cz for CultureCode. + */ public static final CultureCode CS_CZ = fromString("cs-cz"); - /** Static value pl-pl for CultureCode. */ + /** + * Static value pl-pl for CultureCode. + */ public static final CultureCode PL_PL = fromString("pl-pl"); - /** Static value tr-tr for CultureCode. */ + /** + * Static value tr-tr for CultureCode. + */ public static final CultureCode TR_TR = fromString("tr-tr"); - /** Static value da-dk for CultureCode. */ + /** + * Static value da-dk for CultureCode. + */ public static final CultureCode DA_DK = fromString("da-dk"); - /** Static value en-gb for CultureCode. */ + /** + * Static value en-gb for CultureCode. + */ public static final CultureCode EN_GB = fromString("en-gb"); - /** Static value hu-hu for CultureCode. */ + /** + * Static value hu-hu for CultureCode. + */ public static final CultureCode HU_HU = fromString("hu-hu"); - /** Static value nb-no for CultureCode. */ + /** + * Static value nb-no for CultureCode. + */ public static final CultureCode NB_NO = fromString("nb-no"); - /** Static value nl-nl for CultureCode. */ + /** + * Static value nl-nl for CultureCode. + */ public static final CultureCode NL_NL = fromString("nl-nl"); - /** Static value pt-pt for CultureCode. */ + /** + * Static value pt-pt for CultureCode. + */ public static final CultureCode PT_PT = fromString("pt-pt"); - /** Static value sv-se for CultureCode. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding CultureCode. */ @@ -84,7 +137,11 @@ public static CultureCode fromString(String name) { return fromString(name, CultureCode.class); } - /** @return known CultureCode values. */ + /** + * Gets known CultureCode values. + * + * @return known CultureCode values. + */ public static Collection values() { return values(CultureCode.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CurrentSpend.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/CurrentSpend.java index 7d1ef07753c7..5220df7b3a6c 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,14 @@ 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. */ +/** + * 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,9 +25,15 @@ 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. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -38,7 +42,7 @@ public BigDecimal amount() { /** * Get the unit property: The unit of measure for the budget amount. - * + * * @return the unit value. */ public String unit() { @@ -47,7 +51,7 @@ public String unit() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Datagrain.java index d1552a898e91..2b6b83635db5 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Datagrain. */ +/** + * Defines values for Datagrain. + */ public final class Datagrain extends ExpandableStringEnum { - /** Static value daily for Datagrain. */ + /** + * Static value daily for Datagrain. + */ public static final Datagrain DAILY = fromString("daily"); - /** Static value monthly for Datagrain. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding Datagrain. */ @@ -27,7 +42,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 df38c206548c..b80215071c1d 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 @@ -7,25 +7,27 @@ import com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of EventSummary. */ +/** + * An immutable client-side representation of EventSummary. + */ public interface EventSummary { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); @@ -33,28 +35,28 @@ public interface EventSummary { /** * 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 transactionDate property: The date of the event. - * + * * @return the transactionDate value. */ OffsetDateTime transactionDate(); /** * Gets the description property: The description of the event. - * + * * @return the description value. */ String description(); /** * Gets the newCredit property: The amount of new credit or commitment for NewCredit or SettleCharges event. - * + * * @return the newCredit value. */ Amount newCredit(); @@ -62,35 +64,50 @@ public interface EventSummary { /** * Gets the adjustments property: The amount of balance adjustment. The property is not available for * ConsumptionCommitment lots. - * + * * @return the adjustments value. */ Amount adjustments(); /** * Gets the creditExpired property: The amount of expired credit or commitment for NewCredit or SettleCharges event. - * + * * @return the creditExpired value. */ Amount creditExpired(); /** * Gets the charges property: The amount of charges for events of type SettleCharges and PendingEligibleCharges. - * + * * @return the charges value. */ Amount charges(); /** - * Gets the closedBalance property: The balance after the event. - * + * Gets the closedBalance property: The balance after the event, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalance value. */ Amount closedBalance(); + /** + * Gets the billingAccountId property: Identifier of the billing account. + * + * @return the billingAccountId value. + */ + String billingAccountId(); + + /** + * Gets the billingAccountDisplayName property: Name of the billing account. + * + * @return the billingAccountDisplayName value. + */ + String billingAccountDisplayName(); + /** * Gets the eventType property: Identifies the type of the event. - * + * * @return the eventType value. */ EventType eventType(); @@ -98,7 +115,7 @@ public interface EventSummary { /** * Gets the invoiceNumber property: The number which uniquely identifies the invoice on which the event was billed. * This will be empty for unbilled events. - * + * * @return the invoiceNumber value. */ String invoiceNumber(); @@ -106,7 +123,7 @@ public interface EventSummary { /** * Gets the billingProfileId property: The ID that uniquely identifies the billing profile for which the event * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileId value. */ String billingProfileId(); @@ -114,49 +131,49 @@ public interface EventSummary { /** * Gets the billingProfileDisplayName property: The display name of the billing profile for which the event * happened. The property is only available for billing account of type MicrosoftCustomerAgreement. - * + * * @return the billingProfileDisplayName value. */ String billingProfileDisplayName(); /** * Gets the lotId property: The ID that uniquely identifies the lot for which the event happened. - * + * * @return the lotId value. */ String lotId(); /** * Gets the lotSource property: Identifies the source of the lot for which the event happened. - * + * * @return the lotSource value. */ String lotSource(); /** * Gets the canceledCredit property: Amount of canceled credit. - * + * * @return the canceledCredit value. */ Amount canceledCredit(); /** * Gets the creditCurrency property: The credit currency of the event. - * + * * @return the creditCurrency value. */ String creditCurrency(); /** * Gets the billingCurrency property: The billing currency of the event. - * + * * @return the billingCurrency value. */ String billingCurrency(); /** * Gets the reseller property: The reseller of the event. - * + * * @return the reseller value. */ Reseller reseller(); @@ -164,7 +181,7 @@ public interface EventSummary { /** * Gets the creditExpiredInBillingCurrency property: The amount of expired credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the creditExpiredInBillingCurrency value. */ AmountWithExchangeRate creditExpiredInBillingCurrency(); @@ -172,14 +189,14 @@ public interface EventSummary { /** * Gets the newCreditInBillingCurrency property: The amount of new credit or commitment for NewCredit or * SettleCharges event in billing currency. - * + * * @return the newCreditInBillingCurrency value. */ AmountWithExchangeRate newCreditInBillingCurrency(); /** * Gets the adjustmentsInBillingCurrency property: The amount of balance adjustment in billing currency. - * + * * @return the adjustmentsInBillingCurrency value. */ AmountWithExchangeRate adjustmentsInBillingCurrency(); @@ -187,28 +204,37 @@ public interface EventSummary { /** * Gets the chargesInBillingCurrency property: The amount of charges for events of type SettleCharges and * PendingEligibleCharges in billing currency. - * + * * @return the chargesInBillingCurrency value. */ AmountWithExchangeRate chargesInBillingCurrency(); /** - * Gets the closedBalanceInBillingCurrency property: The balance in billing currency after the event. - * + * Gets the closedBalanceInBillingCurrency property: The balance in billing currency after the event, Note: This + * will not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the closedBalanceInBillingCurrency value. */ 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. - * + * * @return the etagPropertiesEtag value. */ String etagPropertiesEtag(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner object. - * + * * @return the inner object. */ EventSummaryInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventType.java index f5962311e4e5..82e74c664318 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,32 +8,62 @@ 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. */ + /** + * Static value SettledCharges for EventType. + */ public static final EventType SETTLED_CHARGES = fromString("SettledCharges"); - /** Static value PendingCharges for EventType. */ + /** + * Static value PendingCharges for EventType. + */ public static final EventType PENDING_CHARGES = fromString("PendingCharges"); - /** Static value PendingAdjustments for EventType. */ + /** + * Static value PendingAdjustments for EventType. + */ public static final EventType PENDING_ADJUSTMENTS = fromString("PendingAdjustments"); - /** Static value PendingNewCredit for EventType. */ + /** + * Static value PendingNewCredit for EventType. + */ public static final EventType PENDING_NEW_CREDIT = fromString("PendingNewCredit"); - /** Static value PendingExpiredCredit for EventType. */ + /** + * Static value PendingExpiredCredit for EventType. + */ public static final EventType PENDING_EXPIRED_CREDIT = fromString("PendingExpiredCredit"); - /** Static value UnKnown for EventType. */ + /** + * Static value UnKnown for EventType. + */ public static final EventType UN_KNOWN = fromString("UnKnown"); - /** Static value NewCredit for EventType. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding EventType. */ @@ -42,7 +72,11 @@ public static EventType fromString(String name) { return fromString(name, EventType.class); } - /** @return known EventType values. */ + /** + * Gets known EventType values. + * + * @return known EventType values. + */ public static Collection values() { return values(EventType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Events.java index f2c17db4b19b..19f75002b41c 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/EventsOperations.java index 8dba4861b35d..81deeaa54777 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 @@ -7,12 +7,14 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of EventsOperations. */ +/** + * Resource collection API of EventsOperations. + */ public interface EventsOperations { /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -20,15 +22,15 @@ 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); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, String startDate, + String endDate); /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param billingProfileId Azure Billing Profile ID. * @param startDate Start date. @@ -37,36 +39,36 @@ 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); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, String startDate, + String endDate, Context context); /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingAccount(String billingAccountId); /** * Lists the events that decrements Azure credits or Microsoft Azure consumption commitment for a billing account or * a billing profile for a given start and end date. - * + * * @param billingAccountId BillingAccount ID. * @param filter May be used to filter the events by lotId, lotSource etc. The filter supports 'eq', 'lt', 'gt', - * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair - * string where key and value is separated by a colon (:). + * 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string + * where key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing event summary. + * @return result of listing event summary as paginated response with {@link PagedIterable}. */ PagedIterable listByBillingAccount(String billingAccountId, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ForecastSpend.java index 4ac1667b49b1..7d6cf0320a5b 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,16 @@ 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. */ +/** + * 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,10 +25,16 @@ 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. - * + * * @return the amount value. */ public BigDecimal amount() { @@ -41,7 +43,7 @@ public BigDecimal amount() { /** * Get the unit property: The unit of measure for the budget amount. - * + * * @return the unit value. */ public String unit() { @@ -50,7 +52,7 @@ public String unit() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyChargeSummary.java index 084f7dd40a58..7de9ccb08849 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,18 +7,25 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; -/** Legacy charge summary. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Legacy charge summary. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = LegacyChargeSummary.class, visible = true) @JsonTypeName("legacy") @Fluent public final class LegacyChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyChargeSummary.class); + /* + * Specifies the kind of charge summary. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ChargeSummaryKind kind = ChargeSummaryKind.LEGACY; /* * Properties for legacy charge summary @@ -26,16 +33,34 @@ public final class LegacyChargeSummary extends ChargeSummary { @JsonProperty(value = "properties", required = true) private LegacyChargeSummaryProperties innerProperties = new LegacyChargeSummaryProperties(); + /** + * Creates an instance of LegacyChargeSummary class. + */ + public LegacyChargeSummary() { + } + + /** + * Get the kind property: Specifies the kind of charge summary. + * + * @return the kind value. + */ + @Override + public ChargeSummaryKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Properties for legacy charge summary. - * + * * @return the innerProperties value. */ private LegacyChargeSummaryProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public LegacyChargeSummary withEtag(String etag) { super.withEtag(etag); @@ -44,7 +69,7 @@ public LegacyChargeSummary withEtag(String etag) { /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -53,7 +78,7 @@ public String billingPeriodId() { /** * Get the usageStart property: Usage start date. - * + * * @return the usageStart value. */ public String usageStart() { @@ -62,7 +87,7 @@ public String usageStart() { /** * Get the usageEnd property: Usage end date. - * + * * @return the usageEnd value. */ public String usageEnd() { @@ -71,7 +96,7 @@ public String usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public BigDecimal azureCharges() { @@ -80,7 +105,7 @@ public BigDecimal azureCharges() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public BigDecimal chargesBilledSeparately() { @@ -88,17 +113,17 @@ public BigDecimal chargesBilledSeparately() { } /** - * Get the marketplaceCharges property: Marketplace Charges. - * - * @return the marketplaceCharges value. + * Get the azureMarketplaceCharges property: Marketplace Charges. + * + * @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(); } /** * Get the currency property: Currency Code. - * + * * @return the currency value. */ public String currency() { @@ -107,19 +132,20 @@ public String currency() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model LegacyChargeSummary")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model LegacyChargeSummary")); } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(LegacyChargeSummary.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationRecommendation.java index 6ede5b412f97..e06308cc22b6 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,180 +6,88 @@ 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.JsonTypeId; 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") +/** + * Legacy reservation recommendation. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = LegacyReservationRecommendation.class, + visible = true) @JsonTypeName("legacy") @Fluent public final class LegacyReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendation.class); + /* + * Specifies the kind of reservation recommendation. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ReservationRecommendationKind kind = ReservationRecommendationKind.LEGACY; /* * Properties for legacy reservation recommendation */ @JsonProperty(value = "properties", required = true) - private LegacyReservationRecommendationProperties innerProperties = new LegacyReservationRecommendationProperties(); - - /** - * 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(); - } - - /** - * 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(); - } - - /** - * 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(); - } + private LegacyReservationRecommendationProperties properties; /** - * Get the recommendedQuantity property: Recommended quality for reserved instances. - * - * @return the recommendedQuantity value. + * Creates an instance of LegacyReservationRecommendation class. */ - public BigDecimal recommendedQuantity() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); + public LegacyReservationRecommendation() { } /** - * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. - * - * @return the totalCostWithReservedInstances value. + * Get the kind property: Specifies the kind of reservation recommendation. + * + * @return the kind 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(); + @Override + public ReservationRecommendationKind kind() { + return this.kind; } /** - * Get the firstUsageDate property: The usage date for looking back. - * - * @return the firstUsageDate value. + * Get the properties property: Properties for legacy reservation recommendation. + * + * @return the properties value. */ - public OffsetDateTime firstUsageDate() { - return this.innerProperties() == null ? null : this.innerProperties().firstUsageDate(); + public LegacyReservationRecommendationProperties properties() { + return this.properties; } /** - * Get the skuProperties property: List of sku properties. - * - * @return the skuProperties value. + * Set the properties property: Properties for legacy reservation recommendation. + * + * @param properties the properties value to set. + * @return the LegacyReservationRecommendation object itself. */ - public List skuProperties() { - return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); + public LegacyReservationRecommendation withProperties(LegacyReservationRecommendationProperties properties) { + this.properties = properties; + return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model LegacyReservationRecommendation")); + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "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 79% 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 521171b6a9d1..20756cb8e20c 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,16 +2,12 @@ // 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; @@ -19,20 +15,26 @@ import java.util.List; import java.util.UUID; -/** The properties of the reservation recommendation. */ +/** + * The properties of the reservation recommendation. + */ @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, property = "scope", - defaultImpl = LegacyReservationRecommendationProperties.class) + defaultImpl = LegacyReservationRecommendationProperties.class, + visible = true) @JsonTypeName("LegacyReservationRecommendationProperties") @JsonSubTypes({ @JsonSubTypes.Type(name = "Single", value = LegacySingleScopeReservationRecommendationProperties.class), - @JsonSubTypes.Type(name = "Shared", value = LegacySharedScopeReservationRecommendationProperties.class) -}) + @JsonSubTypes.Type(name = "Shared", value = LegacySharedScopeReservationRecommendationProperties.class) }) @Immutable public class LegacyReservationRecommendationProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyReservationRecommendationProperties.class); + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope; /* * The number of days of usage to look back for recommendation. @@ -118,9 +120,37 @@ public class LegacyReservationRecommendationProperties { @JsonProperty(value = "skuProperties", access = JsonProperty.Access.WRITE_ONLY) private List skuProperties; + /* + * The last usage date used for looking back for computing the recommendation. + */ + @JsonProperty(value = "lastUsageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUsageDate; + + /* + * The total hours for which the cost is covered. + */ + @JsonProperty(value = "totalHours", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalHours; + + /** + * Creates an instance of LegacyReservationRecommendationProperties class. + */ + public LegacyReservationRecommendationProperties() { + this.scope = "LegacyReservationRecommendationProperties"; + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + /** * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. - * + * * @return the lookBackPeriod value. */ public String lookBackPeriod() { @@ -129,7 +159,7 @@ public String lookBackPeriod() { /** * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * + * * @return the instanceFlexibilityRatio value. */ public Float instanceFlexibilityRatio() { @@ -138,7 +168,7 @@ public Float instanceFlexibilityRatio() { /** * Get the instanceFlexibilityGroup property: The instance Flexibility Group. - * + * * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { @@ -147,7 +177,7 @@ public String instanceFlexibilityGroup() { /** * Get the normalizedSize property: The normalized Size. - * + * * @return the normalizedSize value. */ public String normalizedSize() { @@ -156,7 +186,7 @@ public String normalizedSize() { /** * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. - * + * * @return the recommendedQuantityNormalized value. */ public Float recommendedQuantityNormalized() { @@ -165,7 +195,7 @@ public Float recommendedQuantityNormalized() { /** * Get the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ public UUID meterId() { @@ -174,7 +204,7 @@ public UUID meterId() { /** * Get the resourceType property: The azure resource type. - * + * * @return the resourceType value. */ public String resourceType() { @@ -183,7 +213,7 @@ public String resourceType() { /** * Get the term property: RI recommendations in one or three year terms. - * + * * @return the term value. */ public String term() { @@ -192,7 +222,7 @@ public String term() { /** * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. - * + * * @return the costWithNoReservedInstances value. */ public BigDecimal costWithNoReservedInstances() { @@ -201,7 +231,7 @@ public BigDecimal costWithNoReservedInstances() { /** * Get the recommendedQuantity property: Recommended quality for reserved instances. - * + * * @return the recommendedQuantity value. */ public BigDecimal recommendedQuantity() { @@ -210,7 +240,7 @@ public BigDecimal recommendedQuantity() { /** * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. - * + * * @return the totalCostWithReservedInstances value. */ public BigDecimal totalCostWithReservedInstances() { @@ -219,7 +249,7 @@ public BigDecimal totalCostWithReservedInstances() { /** * Get the netSavings property: Total estimated savings with reserved instances. - * + * * @return the netSavings value. */ public BigDecimal netSavings() { @@ -228,7 +258,7 @@ public BigDecimal netSavings() { /** * Get the firstUsageDate property: The usage date for looking back. - * + * * @return the firstUsageDate value. */ public OffsetDateTime firstUsageDate() { @@ -237,16 +267,34 @@ public OffsetDateTime firstUsageDate() { /** * Get the skuProperties property: List of sku properties. - * + * * @return the skuProperties value. */ public List skuProperties() { return this.skuProperties; } + /** + * Get the lastUsageDate property: The last usage date used for looking back for computing the recommendation. + * + * @return the lastUsageDate value. + */ + public OffsetDateTime lastUsageDate() { + return this.lastUsageDate; + } + + /** + * Get the totalHours property: The total hours for which the cost is covered. + * + * @return the totalHours value. + */ + public Integer totalHours() { + return this.totalHours; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyReservationTransaction.java index e9ebfb4c40a4..7e0d8e0b0f11 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,18 +5,22 @@ 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. */ +/** + * 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySharedScopeReservationRecommendationProperties.java index df0ec268d775..6a93a8beb4df 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,24 +5,49 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** The properties of the legacy reservation recommendation for shared scope. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scope") +/** + * The properties of the legacy reservation recommendation for shared scope. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "scope", + defaultImpl = LegacySharedScopeReservationRecommendationProperties.class, + visible = true) @JsonTypeName("Shared") @Immutable public final class LegacySharedScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySharedScopeReservationRecommendationProperties.class); + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope = "Shared"; + + /** + * Creates an instance of LegacySharedScopeReservationRecommendationProperties class. + */ + public LegacySharedScopeReservationRecommendationProperties() { + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + @Override + public String scope() { + return this.scope; + } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacySingleScopeReservationRecommendationProperties.java index 16fa7d307c55..09bc9644325d 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,22 +5,30 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.util.UUID; -/** The properties of the legacy reservation recommendation for single scope. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "scope") +/** + * The properties of the legacy reservation recommendation for single scope. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "scope", + defaultImpl = LegacySingleScopeReservationRecommendationProperties.class, + visible = true) @JsonTypeName("Single") @Immutable public final class LegacySingleScopeReservationRecommendationProperties extends LegacyReservationRecommendationProperties { - @JsonIgnore - private final ClientLogger logger = new ClientLogger(LegacySingleScopeReservationRecommendationProperties.class); + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope = "Single"; /* * Subscription id associated with single scoped recommendation. @@ -28,9 +36,25 @@ public final class LegacySingleScopeReservationRecommendationProperties @JsonProperty(value = "subscriptionId", access = JsonProperty.Access.WRITE_ONLY) private UUID subscriptionId; + /** + * Creates an instance of LegacySingleScopeReservationRecommendationProperties class. + */ + public LegacySingleScopeReservationRecommendationProperties() { + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + @Override + public String scope() { + return this.scope; + } + /** * Get the subscriptionId property: Subscription id associated with single scoped recommendation. - * + * * @return the subscriptionId value. */ public UUID subscriptionId() { @@ -39,7 +63,7 @@ public UUID subscriptionId() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LegacyUsageDetail.java index 3149ee726979..ce5ae4a84d1d 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,24 +4,31 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** Legacy usage detail. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Legacy usage detail. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = LegacyUsageDetail.class, visible = true) @JsonTypeName("legacy") -@Fluent +@Immutable public final class LegacyUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LegacyUsageDetail.class); + /* + * Specifies the kind of usage details. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private UsageDetailsKind kind = UsageDetailsKind.LEGACY; /* * Properties for legacy usage details @@ -29,9 +36,25 @@ public final class LegacyUsageDetail extends UsageDetailInner { @JsonProperty(value = "properties", required = true) private LegacyUsageDetailProperties innerProperties = new LegacyUsageDetailProperties(); + /** + * Creates an instance of LegacyUsageDetail class. + */ + public LegacyUsageDetail() { + } + + /** + * Get the kind property: Specifies the kind of usage details. + * + * @return the kind value. + */ + @Override + public UsageDetailsKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Properties for legacy usage details. - * + * * @return the innerProperties value. */ private LegacyUsageDetailProperties innerProperties() { @@ -40,7 +63,7 @@ private LegacyUsageDetailProperties innerProperties() { /** * Get the billingAccountId property: Billing Account identifier. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -49,7 +72,7 @@ public String billingAccountId() { /** * Get the billingAccountName property: Billing Account Name. - * + * * @return the billingAccountName value. */ public String billingAccountName() { @@ -58,7 +81,7 @@ public String billingAccountName() { /** * Get the billingPeriodStartDate property: The billing period start date. - * + * * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { @@ -67,7 +90,7 @@ public OffsetDateTime billingPeriodStartDate() { /** * Get the billingPeriodEndDate property: The billing period end date. - * + * * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { @@ -76,7 +99,7 @@ public OffsetDateTime billingPeriodEndDate() { /** * Get the billingProfileId property: Billing Profile identifier. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -85,7 +108,7 @@ public String billingProfileId() { /** * Get the billingProfileName property: Billing Profile Name. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -94,7 +117,7 @@ public String billingProfileName() { /** * Get the accountOwnerId property: Account Owner Id. - * + * * @return the accountOwnerId value. */ public String accountOwnerId() { @@ -103,7 +126,7 @@ public String accountOwnerId() { /** * Get the accountName property: Account Name. - * + * * @return the accountName value. */ public String accountName() { @@ -112,7 +135,7 @@ public String accountName() { /** * Get the subscriptionId property: Subscription guid. - * + * * @return the subscriptionId value. */ public String subscriptionId() { @@ -121,7 +144,7 @@ public String subscriptionId() { /** * Get the subscriptionName property: Subscription name. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -130,7 +153,7 @@ public String subscriptionName() { /** * Get the date property: Date for the usage record. - * + * * @return the date value. */ public OffsetDateTime date() { @@ -139,7 +162,7 @@ public OffsetDateTime date() { /** * Get the product property: Product name for the consumed service or purchase. Not available for Marketplace. - * + * * @return the product value. */ public String product() { @@ -149,7 +172,7 @@ public String product() { /** * Get the partNumber property: Part Number of the service used. Can be used to join with the price sheet. Not * available for marketplace. - * + * * @return the partNumber value. */ public String partNumber() { @@ -160,7 +183,7 @@ public String partNumber() { * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the * reservation is purchased see productOrderName. - * + * * @return the meterId value. */ public UUID meterId() { @@ -170,7 +193,7 @@ public UUID meterId() { /** * Get the meterDetails property: The details about the meter. By default this is not populated, unless it's * specified in $expand. - * + * * @return the meterDetails value. */ public MeterDetailsResponse meterDetails() { @@ -179,7 +202,7 @@ public MeterDetailsResponse meterDetails() { /** * Get the quantity property: The usage quantity. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -188,7 +211,7 @@ public BigDecimal quantity() { /** * Get the effectivePrice property: Effective Price that's charged for the usage. - * + * * @return the effectivePrice value. */ public BigDecimal effectivePrice() { @@ -197,7 +220,7 @@ public BigDecimal effectivePrice() { /** * Get the cost property: The amount of cost before tax. - * + * * @return the cost value. */ public BigDecimal cost() { @@ -206,7 +229,7 @@ public BigDecimal cost() { /** * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). - * + * * @return the unitPrice value. */ public BigDecimal unitPrice() { @@ -215,7 +238,7 @@ public BigDecimal unitPrice() { /** * Get the billingCurrency property: Billing Currency. - * + * * @return the billingCurrency value. */ public String billingCurrency() { @@ -224,7 +247,7 @@ public String billingCurrency() { /** * Get the resourceLocation property: Resource Location. - * + * * @return the resourceLocation value. */ public String resourceLocation() { @@ -234,7 +257,7 @@ public String resourceLocation() { /** * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage * or was purchased. This value is not provided for marketplace usage. - * + * * @return the consumedService value. */ public String consumedService() { @@ -243,7 +266,7 @@ public String consumedService() { /** * Get the resourceId property: Unique identifier of the Azure Resource Manager usage detail resource. - * + * * @return the resourceId value. */ public String resourceId() { @@ -252,7 +275,7 @@ public String resourceId() { /** * Get the resourceName property: Resource Name. - * + * * @return the resourceName value. */ public String resourceName() { @@ -261,7 +284,7 @@ public String resourceName() { /** * Get the serviceInfo1 property: Service-specific metadata. - * + * * @return the serviceInfo1 value. */ public String serviceInfo1() { @@ -270,7 +293,7 @@ public String serviceInfo1() { /** * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. - * + * * @return the serviceInfo2 value. */ public String serviceInfo2() { @@ -281,7 +304,7 @@ public String serviceInfo2() { * Get the additionalInfo property: Additional details of this usage item. By default this is not populated, unless * it's specified in $expand. Use this field to get usage line item specific details such as the actual VM Size * (ServiceType) or the ratio in which the reservation discount is applied. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -290,7 +313,7 @@ public String additionalInfo() { /** * Get the invoiceSection property: Invoice Section Name. - * + * * @return the invoiceSection value. */ public String invoiceSection() { @@ -300,7 +323,7 @@ public String invoiceSection() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -309,7 +332,7 @@ public String costCenter() { /** * Get the resourceGroup property: Resource Group Name. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -319,7 +342,7 @@ public String resourceGroup() { /** * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to * reservations. - * + * * @return the reservationId value. */ public String reservationId() { @@ -329,7 +352,7 @@ public String reservationId() { /** * Get the reservationName property: User provided display name of the reservation. Last known name for a particular * day is populated in the daily data. Only applies to records relevant to reservations. - * + * * @return the reservationName value. */ public String reservationName() { @@ -338,7 +361,7 @@ public String reservationName() { /** * Get the productOrderId property: Product Order Id. For reservations this is the Reservation Order ID. - * + * * @return the productOrderId value. */ public String productOrderId() { @@ -347,7 +370,7 @@ public String productOrderId() { /** * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. - * + * * @return the productOrderName value. */ public String productOrderName() { @@ -356,7 +379,7 @@ public String productOrderName() { /** * Get the offerId property: Offer Id. Ex: MS-AZR-0017P, MS-AZR-0148P. - * + * * @return the offerId value. */ public String offerId() { @@ -365,7 +388,7 @@ public String offerId() { /** * Get the isAzureCreditEligible property: Is Azure Credit Eligible. - * + * * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { @@ -375,7 +398,7 @@ public Boolean isAzureCreditEligible() { /** * Get the term property: Term (in months). 1 month for monthly recurring purchase. 12 months for a 1 year * reservation. 36 months for a 3 year reservation. - * + * * @return the term value. */ public String term() { @@ -384,7 +407,7 @@ public String term() { /** * Get the publisherName property: Publisher Name. - * + * * @return the publisherName value. */ public String publisherName() { @@ -393,7 +416,7 @@ public String publisherName() { /** * Get the publisherType property: Publisher Type. - * + * * @return the publisherType value. */ public String publisherType() { @@ -402,7 +425,7 @@ public String publisherType() { /** * Get the planName property: Plan Name. - * + * * @return the planName value. */ public String planName() { @@ -412,7 +435,7 @@ public String planName() { /** * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation * fee, or a refund. - * + * * @return the chargeType value. */ public String chargeType() { @@ -423,7 +446,7 @@ public String chargeType() { * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is * used. - * + * * @return the frequency value. */ public String frequency() { @@ -432,16 +455,34 @@ public String frequency() { /** * Get the payGPrice property: Retail price for the resource. - * + * * @return the payGPrice value. */ public BigDecimal payGPrice() { return this.innerProperties() == null ? null : this.innerProperties().payGPrice(); } + /** + * Get the 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. - * + * * @return the pricingModel value. */ public PricingModelType pricingModel() { @@ -450,19 +491,20 @@ public PricingModelType pricingModel() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model LegacyUsageDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model LegacyUsageDetail")); } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(LegacyUsageDetail.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LookBackPeriod.java index 3488a9665b86..1987bc8d09cd 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for LookBackPeriod. */ +/** + * Defines values for LookBackPeriod. + */ public final class LookBackPeriod extends ExpandableStringEnum { - /** Static value Last7Days for LookBackPeriod. */ + /** + * Static value Last7Days for LookBackPeriod. + */ public static final LookBackPeriod LAST7DAYS = fromString("Last7Days"); - /** Static value Last30Days for LookBackPeriod. */ + /** + * Static value Last30Days for LookBackPeriod. + */ public static final LookBackPeriod LAST30DAYS = fromString("Last30Days"); - /** Static value Last60Days for LookBackPeriod. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding LookBackPeriod. */ @@ -30,7 +47,11 @@ public static LookBackPeriod fromString(String name) { return fromString(name, LookBackPeriod.class); } - /** @return known LookBackPeriod values. */ + /** + * Gets known LookBackPeriod values. + * + * @return known LookBackPeriod values. + */ public static Collection values() { return values(LookBackPeriod.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotSource.java index 9db625833099..bcaa5a995bc0 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,20 +8,37 @@ 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. */ + /** + * Static value PurchasedCredit for LotSource. + */ public static final LotSource PURCHASED_CREDIT = fromString("PurchasedCredit"); - /** Static value PromotionalCredit for LotSource. */ + /** + * Static value PromotionalCredit for LotSource. + */ public static final LotSource PROMOTIONAL_CREDIT = fromString("PromotionalCredit"); - /** Static value ConsumptionCommitment for LotSource. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding LotSource. */ @@ -30,7 +47,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 637c2f110b65..c760835a1428 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 @@ -7,25 +7,27 @@ import com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner; import java.time.OffsetDateTime; -/** An immutable client-side representation of LotSummary. */ +/** + * An immutable client-side representation of LotSummary. + */ public interface LotSummary { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); @@ -33,42 +35,43 @@ public interface LotSummary { /** * 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 originalAmount property: The original amount of a lot. - * + * Gets the originalAmount property: The original amount of a lot, Note: This will not be returned for Contributor + * Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmount value. */ Amount originalAmount(); /** * Gets the closedBalance property: The balance as of the last invoice. - * + * * @return the closedBalance value. */ Amount closedBalance(); /** * Gets the source property: The source of the lot. - * + * * @return the source value. */ LotSource source(); /** * Gets the startDate property: The date when the lot became effective. - * + * * @return the startDate value. */ OffsetDateTime startDate(); /** * Gets the expirationDate property: The expiration date of a lot. - * + * * @return the expirationDate value. */ OffsetDateTime expirationDate(); @@ -76,70 +79,93 @@ public interface LotSummary { /** * Gets the poNumber property: The po number of the invoice on which the lot was added. This property is not * available for ConsumptionCommitment lots. - * + * * @return the poNumber value. */ String poNumber(); /** * Gets the purchasedDate property: The date when the lot was added. - * + * * @return the purchasedDate value. */ OffsetDateTime purchasedDate(); /** * Gets the status property: The status of the lot. - * + * * @return the status value. */ Status status(); /** * Gets the creditCurrency property: The currency of the lot. - * + * * @return the creditCurrency value. */ String creditCurrency(); /** * Gets the billingCurrency property: The billing currency of the lot. - * + * * @return the billingCurrency value. */ String billingCurrency(); /** - * Gets the originalAmountInBillingCurrency property: The original amount of a lot in billing currency. - * + * Gets the originalAmountInBillingCurrency property: The original amount of a lot in billing currency, Note: This + * will not be returned for Contributor Organization Type in Multi-Entity consumption commitment. + * * @return the originalAmountInBillingCurrency value. */ AmountWithExchangeRate originalAmountInBillingCurrency(); /** * Gets the closedBalanceInBillingCurrency property: The balance as of the last invoice in billing currency. - * + * * @return the closedBalanceInBillingCurrency value. */ AmountWithExchangeRate closedBalanceInBillingCurrency(); /** * Gets the reseller property: The reseller of the lot. - * + * * @return the reseller value. */ Reseller reseller(); + /** + * Gets the 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. - * + * * @return the etagPropertiesEtag value. */ String etagPropertiesEtag(); + /** + * Gets the organizationType property: The organization type of the lot. + * + * @return the organizationType value. + */ + OrganizationType organizationType(); + + /** + * Gets the usedAmount property: Amount consumed from the commitment. + * + * @return the usedAmount value. + */ + Amount usedAmount(); + /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner object. - * + * * @return the inner object. */ LotSummaryInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Lots.java index 580dabac15b6..40e3c916b8fa 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/LotsOperations.java index bab1d91c0f17..5637f567ff29 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 @@ -7,60 +7,92 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of LotsOperations. */ +/** + * 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. * @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. + * @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', - * '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 (:). + * 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where + * key and value is separated by a colon (:). * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing lot summary. + * @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/ManagementGroupAggregatedCostResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java index 36c2dcef4774..1145cdacb0b0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ManagementGroupAggregatedCostResult.java @@ -10,95 +10,97 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of ManagementGroupAggregatedCostResult. */ +/** + * An immutable client-side representation of ManagementGroupAggregatedCostResult. + */ public interface ManagementGroupAggregatedCostResult { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the billingPeriodId property: The id of the billing period resource that the aggregated cost belongs to. - * + * * @return the billingPeriodId value. */ String billingPeriodId(); /** * Gets the usageStart property: The start of the date time range covered by aggregated cost. - * + * * @return the usageStart value. */ OffsetDateTime usageStart(); /** * Gets the usageEnd property: The end of the date time range covered by the aggregated cost. - * + * * @return the usageEnd value. */ OffsetDateTime usageEnd(); /** * Gets the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ BigDecimal azureCharges(); /** * Gets the marketplaceCharges property: Marketplace Charges. - * + * * @return the marketplaceCharges value. */ BigDecimal marketplaceCharges(); /** * Gets the chargesBilledSeparately property: Charges Billed Separately. - * + * * @return the chargesBilledSeparately value. */ BigDecimal chargesBilledSeparately(); /** * Gets the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ String currency(); /** * Gets the children property: Children of a management group. - * + * * @return the children value. */ List children(); @@ -106,7 +108,7 @@ public interface ManagementGroupAggregatedCostResult { /** * Gets the includedSubscriptions property: List of subscription Guids included in the calculation of aggregated * cost. - * + * * @return the includedSubscriptions value. */ List includedSubscriptions(); @@ -114,7 +116,7 @@ public interface ManagementGroupAggregatedCostResult { /** * Gets the excludedSubscriptions property: List of subscription Guids excluded from the calculation of aggregated * cost. - * + * * @return the excludedSubscriptions value. */ List excludedSubscriptions(); @@ -122,7 +124,7 @@ public interface ManagementGroupAggregatedCostResult { /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner * object. - * + * * @return the inner object. */ ManagementGroupAggregatedCostResultInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java index 1574bc764b08..44e6ff87dcd2 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplace.java @@ -10,193 +10,195 @@ import java.util.Map; import java.util.UUID; -/** An immutable client-side representation of Marketplace. */ +/** + * An immutable client-side representation of Marketplace. + */ public interface Marketplace { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the billingPeriodId property: The id of the billing period resource that the usage belongs to. - * + * * @return the billingPeriodId value. */ String billingPeriodId(); /** * Gets the usageStart property: The start of the date time range covered by the usage detail. - * + * * @return the usageStart value. */ OffsetDateTime usageStart(); /** * Gets the usageEnd property: The end of the date time range covered by the usage detail. - * + * * @return the usageEnd value. */ OffsetDateTime usageEnd(); /** * Gets the resourceRate property: The marketplace resource rate. - * + * * @return the resourceRate value. */ BigDecimal resourceRate(); /** * Gets the offerName property: The type of offer. - * + * * @return the offerName value. */ String offerName(); /** * Gets the resourceGroup property: The name of resource group. - * + * * @return the resourceGroup value. */ String resourceGroup(); /** * Gets the additionalInfo property: Additional information. - * + * * @return the additionalInfo value. */ String additionalInfo(); /** * Gets the orderNumber property: The order number. - * + * * @return the orderNumber value. */ String orderNumber(); /** * Gets the instanceName property: The name of the resource instance that the usage is about. - * + * * @return the instanceName value. */ String instanceName(); /** * Gets the instanceId property: The uri of the resource instance that the usage is about. - * + * * @return the instanceId value. */ String instanceId(); /** * Gets the currency property: The ISO currency in which the meter is charged, for example, USD. - * + * * @return the currency value. */ String currency(); /** * Gets the consumedQuantity property: The quantity of usage. - * + * * @return the consumedQuantity value. */ BigDecimal consumedQuantity(); /** * Gets the unitOfMeasure property: The unit of measure. - * + * * @return the unitOfMeasure value. */ String unitOfMeasure(); /** * Gets the pretaxCost property: The amount of cost before tax. - * + * * @return the pretaxCost value. */ BigDecimal pretaxCost(); /** * Gets the isEstimated property: The estimated usage is subject to change. - * + * * @return the isEstimated value. */ Boolean isEstimated(); /** * Gets the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ UUID meterId(); /** * Gets the subscriptionGuid property: Subscription guid. - * + * * @return the subscriptionGuid value. */ UUID subscriptionGuid(); /** * Gets the subscriptionName property: Subscription name. - * + * * @return the subscriptionName value. */ String subscriptionName(); /** * Gets the accountName property: Account name. - * + * * @return the accountName value. */ String accountName(); /** * Gets the departmentName property: Department name. - * + * * @return the departmentName value. */ String departmentName(); /** * Gets the consumedService property: Consumed service name. - * + * * @return the consumedService value. */ String consumedService(); /** * Gets the costCenter property: The cost center of this department if it is a department and a costcenter exists. - * + * * @return the costCenter value. */ String costCenter(); @@ -204,35 +206,35 @@ public interface Marketplace { /** * Gets the additionalProperties property: Additional details of this usage item. By default this is not populated, * unless it's specified in $expand. - * + * * @return the additionalProperties value. */ String additionalProperties(); /** * Gets the publisherName property: The name of publisher. - * + * * @return the publisherName value. */ String publisherName(); /** * Gets the planName property: The name of plan. - * + * * @return the planName value. */ String planName(); /** * Gets the isRecurringCharge property: Flag indicating whether this is a recurring charge or not. - * + * * @return the isRecurringCharge value. */ Boolean isRecurringCharge(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner object. - * + * * @return the inner object. */ MarketplaceInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Marketplaces.java index 82433cf0f866..16ba215c70ad 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 @@ -7,53 +7,55 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Marketplaces. */ +/** + * Resource collection API of Marketplaces. + */ public interface Marketplaces { /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); /** * Lists the marketplaces for a scope at the defined scope. Marketplaces are available via this API only for May 1, * 2014 or later. - * + * * @param scope The scope associated with marketplace 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and ManagementGroup, 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/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. * @param filter May be used to filter marketplaces by properties/usageEnd (Utc time), properties/usageStart (Utc - * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', - * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. + * time), properties/resourceGroup, properties/instanceName or properties/instanceId. The filter supports 'eq', + * 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. * @param top May be used to limit the number of results to the most recent N marketplaces. * @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. + * 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 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 marketplaces. + * @return result of listing marketplaces as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope, String filter, Integer top, String skiptoken, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MarketplacesListResult.java index 2743240b9f0b..8136368aa29a 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,9 +27,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -42,7 +44,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetails.java index 26cbeec938a6..6dbcc712c7e2 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,14 @@ 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. */ +/** + * 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 +20,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,9 +67,15 @@ 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. - * + * * @return the meterName value. */ public String meterName() { @@ -83,7 +84,7 @@ public String meterName() { /** * Get the meterCategory property: The category of the meter, for example, 'Cloud services', 'Networking', etc.. - * + * * @return the meterCategory value. */ public String meterCategory() { @@ -93,7 +94,7 @@ public String meterCategory() { /** * Get the meterSubCategory property: The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute * (IXP)', etc.. - * + * * @return the meterSubCategory value. */ public String meterSubCategory() { @@ -102,7 +103,7 @@ public String meterSubCategory() { /** * Get the unit property: The unit in which the meter consumption is charged, for example, 'Hours', 'GB', etc. - * + * * @return the unit value. */ public String unit() { @@ -111,7 +112,7 @@ public String unit() { /** * Get the meterLocation property: The location in which the Azure service is available. - * + * * @return the meterLocation value. */ public String meterLocation() { @@ -120,7 +121,7 @@ public String meterLocation() { /** * Get the totalIncludedQuantity property: The total included quantity associated with the offer. - * + * * @return the totalIncludedQuantity value. */ public BigDecimal totalIncludedQuantity() { @@ -129,7 +130,7 @@ public BigDecimal totalIncludedQuantity() { /** * Get the pretaxStandardRate property: The pretax listing price. - * + * * @return the pretaxStandardRate value. */ public BigDecimal pretaxStandardRate() { @@ -138,7 +139,7 @@ public BigDecimal pretaxStandardRate() { /** * Get the serviceName property: The name of the service. - * + * * @return the serviceName value. */ public String serviceName() { @@ -147,7 +148,7 @@ public String serviceName() { /** * Get the serviceTier property: The service tier. - * + * * @return the serviceTier value. */ public String serviceTier() { @@ -156,7 +157,7 @@ public String serviceTier() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/MeterDetailsResponse.java index 9a2fd82709ff..7e55056f6e39 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,13 @@ 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. */ +/** + * 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 +19,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,9 +42,15 @@ 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. - * + * * @return the meterName value. */ public String meterName() { @@ -58,7 +59,7 @@ public String meterName() { /** * Get the meterCategory property: The category of the meter, for example, 'Cloud services', 'Networking', etc.. - * + * * @return the meterCategory value. */ public String meterCategory() { @@ -68,7 +69,7 @@ public String meterCategory() { /** * Get the meterSubCategory property: The subcategory of the meter, for example, 'A6 Cloud services', 'ExpressRoute * (IXP)', etc.. - * + * * @return the meterSubCategory value. */ public String meterSubCategory() { @@ -78,7 +79,7 @@ public String meterSubCategory() { /** * Get the unitOfMeasure property: The unit in which the meter consumption is charged, for example, 'Hours', 'GB', * etc. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -87,7 +88,7 @@ public String unitOfMeasure() { /** * Get the serviceFamily property: The service family. - * + * * @return the serviceFamily value. */ public String serviceFamily() { @@ -96,7 +97,7 @@ public String serviceFamily() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Metrictype.java index 1d6e46c7ce5d..fbdc9c5f8154 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 @@ -8,20 +8,37 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Metrictype. */ +/** + * Defines values for Metrictype. + */ public final class Metrictype extends ExpandableStringEnum { - /** Static value actualcost for Metrictype. */ + /** + * Static value actualcost for Metrictype. + */ public static final Metrictype ACTUALCOST = fromString("actualcost"); - /** Static value amortizedcost for Metrictype. */ + /** + * Static value amortizedcost for Metrictype. + */ public static final Metrictype AMORTIZEDCOST = fromString("amortizedcost"); - /** Static value usage for Metrictype. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding Metrictype. */ @@ -30,7 +47,11 @@ public static Metrictype fromString(String name) { return fromString(name, Metrictype.class); } - /** @return known Metrictype values. */ + /** + * Gets known Metrictype values. + * + * @return known Metrictype values. + */ public static Collection values() { return values(Metrictype.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernChargeSummary.java index d15dcf28111c..8c702d3e0f69 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,17 +7,24 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; -/** Modern charge summary. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Modern charge summary. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ModernChargeSummary.class, visible = true) @JsonTypeName("modern") @Fluent public final class ModernChargeSummary extends ChargeSummary { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernChargeSummary.class); + /* + * Specifies the kind of charge summary. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ChargeSummaryKind kind = ChargeSummaryKind.MODERN; /* * Properties for modern charge summary @@ -25,16 +32,34 @@ public final class ModernChargeSummary extends ChargeSummary { @JsonProperty(value = "properties", required = true) private ModernChargeSummaryProperties innerProperties = new ModernChargeSummaryProperties(); + /** + * Creates an instance of ModernChargeSummary class. + */ + public ModernChargeSummary() { + } + + /** + * Get the kind property: Specifies the kind of charge summary. + * + * @return the kind value. + */ + @Override + public ChargeSummaryKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Properties for modern charge summary. - * + * * @return the innerProperties value. */ private ModernChargeSummaryProperties innerProperties() { return this.innerProperties; } - /** {@inheritDoc} */ + /** + * {@inheritDoc} + */ @Override public ModernChargeSummary withEtag(String etag) { super.withEtag(etag); @@ -43,7 +68,7 @@ public ModernChargeSummary withEtag(String etag) { /** * Get the billingPeriodId property: The id of the billing period resource that the charge belongs to. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -52,7 +77,7 @@ public String billingPeriodId() { /** * Get the usageStart property: Usage start date. - * + * * @return the usageStart value. */ public String usageStart() { @@ -61,7 +86,7 @@ public String usageStart() { /** * Get the usageEnd property: Usage end date. - * + * * @return the usageEnd value. */ public String usageEnd() { @@ -70,7 +95,7 @@ public String usageEnd() { /** * Get the azureCharges property: Azure Charges. - * + * * @return the azureCharges value. */ public Amount azureCharges() { @@ -79,7 +104,7 @@ public Amount azureCharges() { /** * Get the chargesBilledSeparately property: Charges Billed separately. - * + * * @return the chargesBilledSeparately value. */ public Amount chargesBilledSeparately() { @@ -88,7 +113,7 @@ public Amount chargesBilledSeparately() { /** * Get the marketplaceCharges property: Marketplace Charges. - * + * * @return the marketplaceCharges value. */ public Amount marketplaceCharges() { @@ -97,7 +122,7 @@ public Amount marketplaceCharges() { /** * Get the billingAccountId property: Billing Account Id. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -106,7 +131,7 @@ public String billingAccountId() { /** * Get the billingProfileId property: Billing Profile Id. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -115,7 +140,7 @@ public String billingProfileId() { /** * Get the invoiceSectionId property: Invoice Section Id. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -124,7 +149,7 @@ public String invoiceSectionId() { /** * Get the customerId property: Customer Id. - * + * * @return the customerId value. */ public String customerId() { @@ -133,28 +158,38 @@ public String customerId() { /** * Get the isInvoiced property: Is charge Invoiced. - * + * * @return the isInvoiced value. */ 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. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ModernChargeSummary")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ModernChargeSummary")); } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernChargeSummary.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationRecommendation.java index 85f3bd155f59..4e292bbb6bfb 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,198 +6,88 @@ 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.JsonTypeId; 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") +/** + * Modern reservation recommendation. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "kind", + defaultImpl = ModernReservationRecommendation.class, + visible = true) @JsonTypeName("modern") @Fluent public final class ModernReservationRecommendation extends ReservationRecommendationInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernReservationRecommendation.class); + /* + * Specifies the kind of reservation recommendation. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private ReservationRecommendationKind kind = ReservationRecommendationKind.MODERN; /* * 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(); - } - - /** - * 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 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(); - } + private ModernReservationRecommendationProperties properties; /** - * Get the recommendedQuantity property: Recommended quality for reserved instances. - * - * @return the recommendedQuantity value. + * Creates an instance of ModernReservationRecommendation class. */ - public BigDecimal recommendedQuantity() { - return this.innerProperties() == null ? null : this.innerProperties().recommendedQuantity(); + public ModernReservationRecommendation() { } /** - * Get the totalCostWithReservedInstances property: The total amount of cost with reserved instances. - * - * @return the totalCostWithReservedInstances value. + * Get the kind property: Specifies the kind of reservation recommendation. + * + * @return the kind 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(); + @Override + public ReservationRecommendationKind kind() { + return this.kind; } /** - * Get the skuProperties property: List of sku properties. - * - * @return the skuProperties value. + * Get the properties property: Properties for modern reservation recommendation. + * + * @return the properties value. */ - public List skuProperties() { - return this.innerProperties() == null ? null : this.innerProperties().skuProperties(); + public ModernReservationRecommendationProperties properties() { + return this.properties; } /** - * Get the skuName property: This is the ARM Sku name. - * - * @return the skuName value. + * Set the properties property: Properties for modern reservation recommendation. + * + * @param properties the properties value to set. + * @return the ModernReservationRecommendation object itself. */ - public String skuName() { - return this.innerProperties() == null ? null : this.innerProperties().skuName(); + public ModernReservationRecommendation withProperties(ModernReservationRecommendationProperties properties) { + this.properties = properties; + return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); - if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ModernReservationRecommendation")); + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "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 74% 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 00df5480536b..3142aaf6255c 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,23 +2,39 @@ // 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.JsonTypeId; +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. */ +/** + * The properties of the reservation recommendation. + */ +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + property = "scope", + defaultImpl = ModernReservationRecommendationProperties.class, + visible = true) +@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 { + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope; /* * Resource Location. @@ -80,6 +96,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 +120,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,9 +132,37 @@ public final class ModernReservationRecommendationProperties { @JsonProperty(value = "skuName", access = JsonProperty.Access.WRITE_ONLY) private String skuName; + /* + * The last usage date used for looking back for computing the recommendation. + */ + @JsonProperty(value = "lastUsageDate", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime lastUsageDate; + + /* + * The total hours for which the cost is covered. + */ + @JsonProperty(value = "totalHours", access = JsonProperty.Access.WRITE_ONLY) + private Integer totalHours; + + /** + * Creates an instance of ModernReservationRecommendationProperties class. + */ + public ModernReservationRecommendationProperties() { + this.scope = "ModernReservationRecommendationProperties"; + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + /** * Get the location property: Resource Location. - * + * * @return the location value. */ public String location() { @@ -127,7 +171,7 @@ public String location() { /** * Get the lookBackPeriod property: The number of days of usage to look back for recommendation. - * + * * @return the lookBackPeriod value. */ public Integer lookBackPeriod() { @@ -136,7 +180,7 @@ public Integer lookBackPeriod() { /** * Get the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * + * * @return the instanceFlexibilityRatio value. */ public Float instanceFlexibilityRatio() { @@ -145,7 +189,7 @@ public Float instanceFlexibilityRatio() { /** * Get the instanceFlexibilityGroup property: The instance Flexibility Group. - * + * * @return the instanceFlexibilityGroup value. */ public String instanceFlexibilityGroup() { @@ -154,7 +198,7 @@ public String instanceFlexibilityGroup() { /** * Get the normalizedSize property: The normalized Size. - * + * * @return the normalizedSize value. */ public String normalizedSize() { @@ -163,7 +207,7 @@ public String normalizedSize() { /** * Get the recommendedQuantityNormalized property: The recommended Quantity Normalized. - * + * * @return the recommendedQuantityNormalized value. */ public Float recommendedQuantityNormalized() { @@ -172,7 +216,7 @@ public Float recommendedQuantityNormalized() { /** * Get the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ public UUID meterId() { @@ -181,7 +225,7 @@ public UUID meterId() { /** * Get the term property: RI recommendations in one or three year terms. - * + * * @return the term value. */ public String term() { @@ -190,7 +234,7 @@ public String term() { /** * Get the costWithNoReservedInstances property: The total amount of cost without reserved instances. - * + * * @return the costWithNoReservedInstances value. */ public Amount costWithNoReservedInstances() { @@ -199,16 +243,25 @@ public Amount costWithNoReservedInstances() { /** * Get the recommendedQuantity property: Recommended quality for reserved instances. - * + * * @return the recommendedQuantity value. */ 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. - * + * * @return the totalCostWithReservedInstances value. */ public Amount totalCostWithReservedInstances() { @@ -217,7 +270,7 @@ public Amount totalCostWithReservedInstances() { /** * Get the netSavings property: Total estimated savings with reserved instances. - * + * * @return the netSavings value. */ public Amount netSavings() { @@ -226,25 +279,16 @@ public Amount netSavings() { /** * Get the firstUsageDate property: The usage date for looking back. - * + * * @return the firstUsageDate value. */ public OffsetDateTime firstUsageDate() { return this.firstUsageDate; } - /** - * Get the scope property: Shared or single recommendation. - * - * @return the scope value. - */ - public String scope() { - return this.scope; - } - /** * Get the skuProperties property: List of sku properties. - * + * * @return the skuProperties value. */ public List skuProperties() { @@ -253,16 +297,34 @@ public List skuProperties() { /** * Get the skuName property: This is the ARM Sku name. - * + * * @return the skuName value. */ public String skuName() { return this.skuName; } + /** + * Get the lastUsageDate property: The last usage date used for looking back for computing the recommendation. + * + * @return the lastUsageDate value. + */ + public OffsetDateTime lastUsageDate() { + return this.lastUsageDate; + } + + /** + * Get the totalHours property: The total hours for which the cost is covered. + * + * @return the totalHours value. + */ + public Integer totalHours() { + return this.totalHours; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransaction.java index 47a4683b5847..a7e9efdfbb52 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 @@ -10,39 +10,41 @@ import java.util.List; import java.util.UUID; -/** An immutable client-side representation of ModernReservationTransaction. */ +/** + * An immutable client-side representation of ModernReservationTransaction. + */ public interface ModernReservationTransaction { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ List tags(); /** * Gets the amount property: The charge of the transaction. - * + * * @return the amount value. */ BigDecimal amount(); @@ -50,112 +52,112 @@ public interface ModernReservationTransaction { /** * Gets the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ String armSkuName(); /** * Gets the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ String billingFrequency(); /** * Gets the billingProfileId property: Billing profile Id. - * + * * @return the billingProfileId value. */ String billingProfileId(); /** * Gets the billingProfileName property: Billing profile name. - * + * * @return the billingProfileName value. */ String billingProfileName(); /** * Gets the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ String currency(); /** * Gets the description property: The description of the transaction. - * + * * @return the description value. */ String description(); /** * Gets the eventDate property: The date of the transaction. - * + * * @return the eventDate value. */ 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. */ String eventType(); /** * Gets the invoice property: Invoice Number. - * + * * @return the invoice value. */ String invoice(); /** * Gets the invoiceId property: Invoice Id as on the invoice where the specific transaction appears. - * + * * @return the invoiceId value. */ String invoiceId(); /** * Gets the invoiceSectionId property: Invoice Section Id. - * + * * @return the invoiceSectionId value. */ String invoiceSectionId(); /** * Gets the invoiceSectionName property: Invoice Section Name. - * + * * @return the invoiceSectionName value. */ String invoiceSectionName(); /** * Gets the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ UUID purchasingSubscriptionGuid(); /** * Gets the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ String purchasingSubscriptionName(); /** * Gets the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ BigDecimal quantity(); /** * Gets the region property: The region of the transaction. - * + * * @return the region value. */ String region(); @@ -164,28 +166,28 @@ public interface ModernReservationTransaction { * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ String reservationOrderId(); /** * Gets the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ String reservationOrderName(); /** * Gets the term property: This is the term of the transaction. - * + * * @return the term value. */ String term(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionInner object. - * + * * @return the inner object. */ ModernReservationTransactionInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernReservationTransactionsListResult.java index 77b4c8422ecb..b3181fda4067 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java new file mode 100644 index 000000000000..bd710fb782f0 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSharedScopeReservationRecommendationProperties.java @@ -0,0 +1,57 @@ +// 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.JsonTypeId; +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, + property = "scope", + defaultImpl = ModernSharedScopeReservationRecommendationProperties.class, + visible = true) +@JsonTypeName("Shared") +@Immutable +public final class ModernSharedScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope = "Shared"; + + /** + * Creates an instance of ModernSharedScopeReservationRecommendationProperties class. + */ + public ModernSharedScopeReservationRecommendationProperties() { + } + + /** + * Get the scope property: Shared or single recommendation. + * + * @return the scope value. + */ + @Override + public String scope() { + return this.scope; + } + + /** + * 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 000000000000..133195953a41 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ModernSingleScopeReservationRecommendationProperties.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeId; +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, + property = "scope", + defaultImpl = ModernSingleScopeReservationRecommendationProperties.class, + visible = true) +@JsonTypeName("Single") +@Immutable +public final class ModernSingleScopeReservationRecommendationProperties + extends ModernReservationRecommendationProperties { + /* + * Shared or single recommendation. + */ + @JsonTypeId + @JsonProperty(value = "scope", required = true) + private String scope = "Single"; + + /* + * 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 scope property: Shared or single recommendation. + * + * @return the scope value. + */ + @Override + public String scope() { + return this.scope; + } + + /** + * 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 8d35112b0136..016b3e54a2f8 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,24 +4,31 @@ 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.JsonTypeId; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; import java.time.OffsetDateTime; import java.util.UUID; -/** Modern usage detail. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "kind") +/** + * Modern usage detail. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "kind", defaultImpl = ModernUsageDetail.class, visible = true) @JsonTypeName("modern") -@Fluent +@Immutable public final class ModernUsageDetail extends UsageDetailInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ModernUsageDetail.class); + /* + * Specifies the kind of usage details. + */ + @JsonTypeId + @JsonProperty(value = "kind", required = true) + private UsageDetailsKind kind = UsageDetailsKind.MODERN; /* * Properties for modern usage details @@ -29,9 +36,25 @@ public final class ModernUsageDetail extends UsageDetailInner { @JsonProperty(value = "properties", required = true) private ModernUsageDetailProperties innerProperties = new ModernUsageDetailProperties(); + /** + * Creates an instance of ModernUsageDetail class. + */ + public ModernUsageDetail() { + } + + /** + * Get the kind property: Specifies the kind of usage details. + * + * @return the kind value. + */ + @Override + public UsageDetailsKind kind() { + return this.kind; + } + /** * Get the innerProperties property: Properties for modern usage details. - * + * * @return the innerProperties value. */ private ModernUsageDetailProperties innerProperties() { @@ -40,7 +63,7 @@ private ModernUsageDetailProperties innerProperties() { /** * Get the billingAccountId property: Billing Account identifier. - * + * * @return the billingAccountId value. */ public String billingAccountId() { @@ -49,7 +72,7 @@ public String billingAccountId() { /** * Get the effectivePrice property: Effective Price that's charged for the usage. - * + * * @return the effectivePrice value. */ public BigDecimal effectivePrice() { @@ -58,7 +81,7 @@ public BigDecimal effectivePrice() { /** * Get the pricingModel property: Identifier that indicates how the meter is priced. - * + * * @return the pricingModel value. */ public PricingModelType pricingModel() { @@ -67,7 +90,7 @@ public PricingModelType pricingModel() { /** * Get the billingAccountName property: Name of the Billing Account. - * + * * @return the billingAccountName value. */ public String billingAccountName() { @@ -76,7 +99,7 @@ public String billingAccountName() { /** * Get the billingPeriodStartDate property: Billing Period Start Date as in the invoice. - * + * * @return the billingPeriodStartDate value. */ public OffsetDateTime billingPeriodStartDate() { @@ -85,7 +108,7 @@ public OffsetDateTime billingPeriodStartDate() { /** * Get the billingPeriodEndDate property: Billing Period End Date as in the invoice. - * + * * @return the billingPeriodEndDate value. */ public OffsetDateTime billingPeriodEndDate() { @@ -96,7 +119,7 @@ public OffsetDateTime billingPeriodEndDate() { * Get the billingProfileId property: Identifier for the billing profile that groups costs across invoices in the a * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. - * + * * @return the billingProfileId value. */ public String billingProfileId() { @@ -107,7 +130,7 @@ public String billingProfileId() { * Get the billingProfileName property: Name of the billing profile that groups costs across invoices in the a * singular billing currency across across the customers who have onboarded the Microsoft customer agreement and the * customers in CSP who have made entitlement purchases like SaaS, Marketplace, RI, etc. - * + * * @return the billingProfileName value. */ public String billingProfileName() { @@ -116,7 +139,7 @@ public String billingProfileName() { /** * Get the subscriptionGuid property: Unique Microsoft generated identifier for the Azure Subscription. - * + * * @return the subscriptionGuid value. */ public String subscriptionGuid() { @@ -125,7 +148,7 @@ public String subscriptionGuid() { /** * Get the subscriptionName property: Name of the Azure Subscription. - * + * * @return the subscriptionName value. */ public String subscriptionName() { @@ -134,7 +157,7 @@ public String subscriptionName() { /** * Get the date property: Date for the usage record. - * + * * @return the date value. */ public OffsetDateTime date() { @@ -144,7 +167,7 @@ public OffsetDateTime date() { /** * Get the product property: Name of the product that has accrued charges by consumption or purchase as listed in * the invoice. Not available for Marketplace. - * + * * @return the product value. */ public String product() { @@ -155,7 +178,7 @@ public String product() { * Get the meterId property: The meter id (GUID). Not available for marketplace. For reserved instance this * represents the primary meter for which the reservation was purchased. For the actual VM Size for which the * reservation is purchased see productOrderName. - * + * * @return the meterId value. */ public UUID meterId() { @@ -164,7 +187,7 @@ public UUID meterId() { /** * Get the meterName property: Identifies the name of the meter against which consumption is measured. - * + * * @return the meterName value. */ public String meterName() { @@ -174,7 +197,7 @@ public String meterName() { /** * Get the meterRegion property: Identifies the location of the datacenter for certain services that are priced * based on datacenter location. - * + * * @return the meterRegion value. */ public String meterRegion() { @@ -183,7 +206,7 @@ public String meterRegion() { /** * Get the meterCategory property: Identifies the top-level service for the usage. - * + * * @return the meterCategory value. */ public String meterCategory() { @@ -192,7 +215,7 @@ public String meterCategory() { /** * Get the meterSubCategory property: Defines the type or sub-category of Azure service that can affect the rate. - * + * * @return the meterSubCategory value. */ public String meterSubCategory() { @@ -202,7 +225,7 @@ public String meterSubCategory() { /** * Get the serviceFamily property: List the service family for the product purchased or charged (Example: Storage ; * Compute). - * + * * @return the serviceFamily value. */ public String serviceFamily() { @@ -212,7 +235,7 @@ public String serviceFamily() { /** * Get the quantity property: Measure the quantity purchased or consumed.The amount of the meter used during the * billing period. - * + * * @return the quantity value. */ public BigDecimal quantity() { @@ -222,7 +245,7 @@ public BigDecimal quantity() { /** * Get the unitOfMeasure property: Identifies the Unit that the service is charged in. For example, GB, hours, * 10,000 s. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -231,7 +254,7 @@ public String unitOfMeasure() { /** * Get the instanceName property: Instance Name. - * + * * @return the instanceName value. */ public String instanceName() { @@ -240,7 +263,7 @@ public String instanceName() { /** * Get the costInUsd property: Estimated extendedCost or blended cost before tax in USD. - * + * * @return the costInUsd value. */ public BigDecimal costInUsd() { @@ -249,7 +272,7 @@ public BigDecimal costInUsd() { /** * Get the unitPrice property: Unit Price is the price applicable to you. (your EA or other contract price). - * + * * @return the unitPrice value. */ public BigDecimal unitPrice() { @@ -258,7 +281,7 @@ public BigDecimal unitPrice() { /** * Get the billingCurrencyCode property: The currency defining the billed cost. - * + * * @return the billingCurrencyCode value. */ public String billingCurrencyCode() { @@ -267,7 +290,7 @@ public String billingCurrencyCode() { /** * Get the resourceLocation property: Name of the resource location. - * + * * @return the resourceLocation value. */ public String resourceLocation() { @@ -277,7 +300,7 @@ public String resourceLocation() { /** * Get the consumedService property: Consumed service name. Name of the azure resource provider that emits the usage * or was purchased. This value is not provided for marketplace usage. - * + * * @return the consumedService value. */ public String consumedService() { @@ -286,7 +309,7 @@ public String consumedService() { /** * Get the serviceInfo1 property: Service-specific metadata. - * + * * @return the serviceInfo1 value. */ public String serviceInfo1() { @@ -295,7 +318,7 @@ public String serviceInfo1() { /** * Get the serviceInfo2 property: Legacy field with optional service-specific metadata. - * + * * @return the serviceInfo2 value. */ public String serviceInfo2() { @@ -306,7 +329,7 @@ public String serviceInfo2() { * Get the additionalInfo property: Additional details of this usage item. Use this field to get usage line item * specific details such as the actual VM Size (ServiceType) or the ratio in which the reservation discount is * applied. - * + * * @return the additionalInfo value. */ public String additionalInfo() { @@ -316,7 +339,7 @@ public String additionalInfo() { /** * Get the invoiceSectionId property: Identifier of the project that is being charged in the invoice. Not applicable * for Microsoft Customer Agreements onboarded by partners. - * + * * @return the invoiceSectionId value. */ public String invoiceSectionId() { @@ -326,7 +349,7 @@ public String invoiceSectionId() { /** * Get the invoiceSectionName property: Name of the project that is being charged in the invoice. Not applicable for * Microsoft Customer Agreements onboarded by partners. - * + * * @return the invoiceSectionName value. */ public String invoiceSectionName() { @@ -336,7 +359,7 @@ public String invoiceSectionName() { /** * Get the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ public String costCenter() { @@ -346,7 +369,7 @@ public String costCenter() { /** * Get the resourceGroup property: Name of the Azure resource group used for cohesive lifecycle management of * resources. - * + * * @return the resourceGroup value. */ public String resourceGroup() { @@ -356,7 +379,7 @@ public String resourceGroup() { /** * Get the reservationId property: ARM resource id of the reservation. Only applies to records relevant to * reservations. - * + * * @return the reservationId value. */ public String reservationId() { @@ -366,7 +389,7 @@ public String reservationId() { /** * Get the reservationName property: User provided display name of the reservation. Last known name for a particular * day is populated in the daily data. Only applies to records relevant to reservations. - * + * * @return the reservationName value. */ public String reservationName() { @@ -376,7 +399,7 @@ public String reservationName() { /** * Get the productOrderId property: The identifier for the asset or Azure plan name that the subscription belongs * to. For example: Azure Plan. For reservations this is the Reservation Order ID. - * + * * @return the productOrderId value. */ public String productOrderId() { @@ -385,7 +408,7 @@ public String productOrderId() { /** * Get the productOrderName property: Product Order Name. For reservations this is the SKU that was purchased. - * + * * @return the productOrderName value. */ public String productOrderName() { @@ -394,7 +417,7 @@ public String productOrderName() { /** * Get the isAzureCreditEligible property: Determines if the cost is eligible to be paid for using Azure credits. - * + * * @return the isAzureCreditEligible value. */ public Boolean isAzureCreditEligible() { @@ -405,7 +428,7 @@ public Boolean isAzureCreditEligible() { * Get the term property: Term (in months). Displays the term for the validity of the offer. For example. In case of * reserved instances it displays 12 months for yearly term of reserved instance. For one time purchases or * recurring purchases, the terms displays 1 month; This is not applicable for Azure consumption. - * + * * @return the term value. */ public String term() { @@ -415,7 +438,7 @@ public String term() { /** * Get the publisherName property: Name of the publisher of the service including Microsoft or Third Party * publishers. - * + * * @return the publisherName value. */ public String publisherName() { @@ -425,7 +448,7 @@ public String publisherName() { /** * Get the publisherType property: Type of publisher that identifies if the publisher is first party, third party * reseller or third party agency. - * + * * @return the publisherType value. */ public String publisherType() { @@ -435,7 +458,7 @@ public String publisherType() { /** * Get the chargeType property: Indicates a charge represents credits, usage, a Marketplace purchase, a reservation * fee, or a refund. - * + * * @return the chargeType value. */ public String chargeType() { @@ -446,7 +469,7 @@ public String chargeType() { * Get the frequency property: Indicates how frequently this charge will occur. OneTime for purchases which only * happen once, Monthly for fees which recur every month, and UsageBased for charges based on how much a service is * used. - * + * * @return the frequency value. */ public String frequency() { @@ -455,7 +478,7 @@ public String frequency() { /** * Get the costInBillingCurrency property: ExtendedCost or blended cost before tax in billed currency. - * + * * @return the costInBillingCurrency value. */ public BigDecimal costInBillingCurrency() { @@ -465,7 +488,7 @@ public BigDecimal costInBillingCurrency() { /** * Get the costInPricingCurrency property: ExtendedCost or blended cost before tax in pricing currency to correlate * with prices. - * + * * @return the costInPricingCurrency value. */ public BigDecimal costInPricingCurrency() { @@ -474,7 +497,7 @@ public BigDecimal costInPricingCurrency() { /** * Get the exchangeRate property: Exchange rate used in conversion from pricing currency to billing currency. - * + * * @return the exchangeRate value. */ public String exchangeRate() { @@ -484,7 +507,7 @@ public String exchangeRate() { /** * Get the exchangeRateDate property: Date on which exchange rate used in conversion from pricing currency to * billing currency. - * + * * @return the exchangeRateDate value. */ public OffsetDateTime exchangeRateDate() { @@ -493,7 +516,7 @@ public OffsetDateTime exchangeRateDate() { /** * Get the invoiceId property: Invoice ID as on the invoice where the specific transaction appears. - * + * * @return the invoiceId value. */ public String invoiceId() { @@ -503,7 +526,7 @@ public String invoiceId() { /** * Get the previousInvoiceId property: Reference to an original invoice there is a refund (negative cost). This is * populated only when there is a refund. - * + * * @return the previousInvoiceId value. */ public String previousInvoiceId() { @@ -512,7 +535,7 @@ public String previousInvoiceId() { /** * Get the pricingCurrencyCode property: Pricing Billing Currency. - * + * * @return the pricingCurrencyCode value. */ public String pricingCurrencyCode() { @@ -522,7 +545,7 @@ public String pricingCurrencyCode() { /** * Get the productIdentifier property: Identifier for the product that has accrued charges by consumption or * purchase . This is the concatenated key of productId and SkuId in partner center. - * + * * @return the productIdentifier value. */ public String productIdentifier() { @@ -531,7 +554,7 @@ public String productIdentifier() { /** * Get the resourceLocationNormalized property: Resource Location Normalized. - * + * * @return the resourceLocationNormalized value. */ public String resourceLocationNormalized() { @@ -541,7 +564,7 @@ public String resourceLocationNormalized() { /** * Get the servicePeriodStartDate property: Start date for the rating period when the service usage was rated for * charges. The prices for Azure services are determined for the rating period. - * + * * @return the servicePeriodStartDate value. */ public OffsetDateTime servicePeriodStartDate() { @@ -551,7 +574,7 @@ public OffsetDateTime servicePeriodStartDate() { /** * Get the servicePeriodEndDate property: End date for the period when the service usage was rated for charges. The * prices for Azure services are determined based on the rating period. - * + * * @return the servicePeriodEndDate value. */ public OffsetDateTime servicePeriodEndDate() { @@ -560,7 +583,7 @@ public OffsetDateTime servicePeriodEndDate() { /** * Get the customerTenantId property: Identifier of the customer's AAD tenant. - * + * * @return the customerTenantId value. */ public String customerTenantId() { @@ -569,7 +592,7 @@ public String customerTenantId() { /** * Get the customerName property: Name of the customer's AAD tenant. - * + * * @return the customerName value. */ public String customerName() { @@ -578,7 +601,7 @@ public String customerName() { /** * Get the partnerTenantId property: Identifier for the partner's AAD tenant. - * + * * @return the partnerTenantId value. */ public String partnerTenantId() { @@ -587,7 +610,7 @@ public String partnerTenantId() { /** * Get the partnerName property: Name of the partner' AAD tenant. - * + * * @return the partnerName value. */ public String partnerName() { @@ -596,7 +619,7 @@ public String partnerName() { /** * Get the resellerMpnId property: MPNId for the reseller associated with the subscription. - * + * * @return the resellerMpnId value. */ public String resellerMpnId() { @@ -605,7 +628,7 @@ public String resellerMpnId() { /** * Get the resellerName property: Reseller Name. - * + * * @return the resellerName value. */ public String resellerName() { @@ -614,7 +637,7 @@ public String resellerName() { /** * Get the publisherId property: Publisher Id. - * + * * @return the publisherId value. */ public String publisherId() { @@ -623,7 +646,7 @@ public String publisherId() { /** * Get the marketPrice property: Market Price that's charged for the usage. - * + * * @return the marketPrice value. */ public BigDecimal marketPrice() { @@ -632,7 +655,7 @@ public BigDecimal marketPrice() { /** * Get the exchangeRatePricingToBilling property: Exchange Rate from pricing currency to billing currency. - * + * * @return the exchangeRatePricingToBilling value. */ public BigDecimal exchangeRatePricingToBilling() { @@ -641,7 +664,7 @@ public BigDecimal exchangeRatePricingToBilling() { /** * Get the paygCostInBillingCurrency property: The amount of PayG cost before tax in billing currency. - * + * * @return the paygCostInBillingCurrency value. */ public BigDecimal paygCostInBillingCurrency() { @@ -650,7 +673,7 @@ public BigDecimal paygCostInBillingCurrency() { /** * Get the paygCostInUsd property: The amount of PayG cost before tax in US Dollar currency. - * + * * @return the paygCostInUsd value. */ public BigDecimal paygCostInUsd() { @@ -660,7 +683,7 @@ public BigDecimal paygCostInUsd() { /** * Get the partnerEarnedCreditRate property: Rate of discount applied if there is a partner earned credit (PEC) * based on partner admin link access. - * + * * @return the partnerEarnedCreditRate value. */ public BigDecimal partnerEarnedCreditRate() { @@ -669,7 +692,7 @@ public BigDecimal partnerEarnedCreditRate() { /** * Get the partnerEarnedCreditApplied property: Flag to indicate if partner earned credit has been applied or not. - * + * * @return the partnerEarnedCreditApplied value. */ public String partnerEarnedCreditApplied() { @@ -678,7 +701,7 @@ public String partnerEarnedCreditApplied() { /** * Get the payGPrice property: Retail price for the resource. - * + * * @return the payGPrice value. */ public BigDecimal payGPrice() { @@ -687,7 +710,7 @@ public BigDecimal payGPrice() { /** * Get the benefitId property: Unique identifier for the applicable benefit. - * + * * @return the benefitId value. */ public String benefitId() { @@ -696,7 +719,7 @@ public String benefitId() { /** * Get the benefitName property: Name of the applicable benefit. - * + * * @return the benefitName value. */ public String benefitName() { @@ -706,7 +729,7 @@ public String benefitName() { /** * Get the provider property: Identifier for Product Category or Line Of Business, Ex - Azure, Microsoft 365, AWS * e.t.c. - * + * * @return the provider value. */ public String provider() { @@ -715,7 +738,7 @@ public String provider() { /** * Get the costAllocationRuleName property: Name for Cost Allocation Rule. - * + * * @return the costAllocationRuleName value. */ public String costAllocationRuleName() { @@ -724,19 +747,20 @@ public String costAllocationRuleName() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ @Override public void validate() { super.validate(); if (innerProperties() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException( - "Missing required property innerProperties in model ModernUsageDetail")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model ModernUsageDetail")); } else { innerProperties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(ModernUsageDetail.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Notification.java index ac6302aac9a7..424517ecb9d0 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,16 +6,15 @@ 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; -/** The notification associated with a budget. */ +/** + * 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 +28,25 @@ 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,9 +63,15 @@ 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. - * + * * @return the enabled value. */ public boolean enabled() { @@ -83,7 +80,7 @@ public boolean enabled() { /** * Set the enabled property: The notification is enabled or not. - * + * * @param enabled the enabled value to set. * @return the Notification object itself. */ @@ -94,7 +91,7 @@ public Notification withEnabled(boolean enabled) { /** * Get the operator property: The comparison operator. - * + * * @return the operator value. */ public OperatorType operator() { @@ -103,7 +100,7 @@ public OperatorType operator() { /** * Set the operator property: The comparison operator. - * + * * @param operator the operator value to set. * @return the Notification object itself. */ @@ -115,7 +112,7 @@ public Notification withOperator(OperatorType operator) { /** * Get the threshold property: 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. - * + * * @return the threshold value. */ public BigDecimal threshold() { @@ -125,7 +122,7 @@ public BigDecimal threshold() { /** * Set the threshold property: 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. - * + * * @param threshold the threshold value to set. * @return the Notification object itself. */ @@ -138,7 +135,7 @@ public Notification withThreshold(BigDecimal threshold) { * Get the contactEmails property: 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. - * + * * @return the contactEmails value. */ public List contactEmails() { @@ -149,7 +146,7 @@ public List contactEmails() { * Set the contactEmails property: 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. - * + * * @param contactEmails the contactEmails value to set. * @return the Notification object itself. */ @@ -160,7 +157,7 @@ public Notification withContactEmails(List contactEmails) { /** * Get the contactRoles property: Contact roles to send the budget notification to when the threshold is exceeded. - * + * * @return the contactRoles value. */ public List contactRoles() { @@ -169,7 +166,7 @@ public List contactRoles() { /** * Set the contactRoles property: Contact roles to send the budget notification to when the threshold is exceeded. - * + * * @param contactRoles the contactRoles value to set. * @return the Notification object itself. */ @@ -181,7 +178,7 @@ public Notification withContactRoles(List contactRoles) { /** * Get the contactGroups property: 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. - * + * * @return the contactGroups value. */ public List contactGroups() { @@ -191,7 +188,7 @@ public List contactGroups() { /** * Set the contactGroups property: 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. - * + * * @param contactGroups the contactGroups value to set. * @return the Notification object itself. */ @@ -202,7 +199,7 @@ public Notification withContactGroups(List contactGroups) { /** * Get the thresholdType property: The type of threshold. - * + * * @return the thresholdType value. */ public ThresholdType thresholdType() { @@ -211,7 +208,7 @@ public ThresholdType thresholdType() { /** * Set the thresholdType property: The type of threshold. - * + * * @param thresholdType the thresholdType value to set. * @return the Notification object itself. */ @@ -222,7 +219,7 @@ public Notification withThresholdType(ThresholdType thresholdType) { /** * Get the locale property: Language in which the recipient will receive the notification. - * + * * @return the locale value. */ public CultureCode locale() { @@ -231,7 +228,7 @@ public CultureCode locale() { /** * Set the locale property: Language in which the recipient will receive the notification. - * + * * @param locale the locale value to set. * @return the Notification object itself. */ @@ -242,24 +239,23 @@ public Notification withLocale(CultureCode locale) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (operator() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property operator in model Notification")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operator in model Notification")); } if (threshold() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property threshold in model Notification")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property threshold in model Notification")); } if (contactEmails() == null) { - throw logger - .logExceptionAsError( - new IllegalArgumentException("Missing required property contactEmails in model Notification")); + throw LOGGER.atError() + .log(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/Operation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operation.java index 1a6b6895c54b..e183fa8cc571 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Operation.java @@ -6,32 +6,34 @@ import com.azure.resourcemanager.consumption.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the id property: Operation Id. - * + * * @return the id value. */ String id(); /** * Gets the name property: Operation name: {provider}/{resource}/{operation}. - * + * * @return the name value. */ String name(); /** * Gets the display property: The object that represents the operation. - * + * * @return the display value. */ OperationDisplay display(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationDisplay.java index b8ba95d21220..d6e73b32aec3 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,13 @@ 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. */ +/** + * 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,9 +36,15 @@ 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. - * + * * @return the provider value. */ public String provider() { @@ -49,7 +53,7 @@ public String provider() { /** * Get the resource property: Resource on which the operation is performed: UsageDetail, etc. - * + * * @return the resource value. */ public String resource() { @@ -58,7 +62,7 @@ public String resource() { /** * Get the operation property: Operation type: Read, write, delete, etc. - * + * * @return the operation value. */ public String operation() { @@ -67,7 +71,7 @@ public String operation() { /** * Get the description property: Description of the operation. - * + * * @return the description value. */ public String description() { @@ -76,7 +80,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationListResult.java index 2c57455a63d5..bf92ea2b2c32 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,9 +27,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -43,7 +44,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results if there are any. - * + * * @return the nextLink value. */ public String nextLink() { @@ -52,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatus.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatus.java new file mode 100644 index 000000000000..a979a4827f87 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatus.java @@ -0,0 +1,41 @@ +// 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 000000000000..3e0460d18825 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperationStatusType.java @@ -0,0 +1,58 @@ +// 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 fb678e85b69a..3ed793534f1c 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 @@ -7,25 +7,27 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * Lists all of the available consumption REST API 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(); /** * Lists all of the available consumption REST API operations. - * + * * @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 consumption operations. + * @return result of listing consumption operations as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OperatorType.java index 3646bcb45a45..53b9daf24a85 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,20 +8,37 @@ 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. */ + /** + * Static value EqualTo for OperatorType. + */ public static final OperatorType EQUAL_TO = fromString("EqualTo"); - /** Static value GreaterThan for OperatorType. */ + /** + * Static value GreaterThan for OperatorType. + */ public static final OperatorType GREATER_THAN = fromString("GreaterThan"); - /** Static value GreaterThanOrEqualTo for OperatorType. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding OperatorType. */ @@ -30,7 +47,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/OrganizationType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OrganizationType.java new file mode 100644 index 000000000000..b6042770dd7d --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/OrganizationType.java @@ -0,0 +1,53 @@ +// 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 organization type of the lot. + */ +public final class OrganizationType extends ExpandableStringEnum { + /** + * Static value Primary for OrganizationType. + */ + public static final OrganizationType PRIMARY = fromString("Primary"); + + /** + * Static value Contributor for OrganizationType. + */ + public static final OrganizationType CONTRIBUTOR = fromString("Contributor"); + + /** + * Creates a new instance of OrganizationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OrganizationType() { + } + + /** + * Creates or finds a OrganizationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OrganizationType. + */ + @JsonCreator + public static OrganizationType fromString(String name) { + return fromString(name, OrganizationType.class); + } + + /** + * Gets known OrganizationType values. + * + * @return known OrganizationType values. + */ + public static Collection values() { + return values(OrganizationType.class); + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetProperties.java index b6643e12645f..55ef5b757bb9 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,17 +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; import java.util.UUID; -/** The properties of the price sheet. */ +/** + * 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 +27,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,9 +68,21 @@ public final class PriceSheetProperties { @JsonProperty(value = "offerId", access = JsonProperty.Access.WRITE_ONLY) private String offerId; + /* + * SavingsPlan Details + */ + @JsonProperty(value = "savingsPlan", access = JsonProperty.Access.WRITE_ONLY) + private SavingsPlan savingsPlan; + + /** + * Creates an instance of PriceSheetProperties class. + */ + public PriceSheetProperties() { + } + /** * Get the billingPeriodId property: The id of the billing period resource that the usage belongs to. - * + * * @return the billingPeriodId value. */ public String billingPeriodId() { @@ -82,7 +91,7 @@ public String billingPeriodId() { /** * Get the meterId property: The meter id (GUID). - * + * * @return the meterId value. */ public UUID meterId() { @@ -92,7 +101,7 @@ public UUID meterId() { /** * Get the meterDetails property: The details about the meter. By default this is not populated, unless it's * specified in $expand. - * + * * @return the meterDetails value. */ public MeterDetails meterDetails() { @@ -101,7 +110,7 @@ public MeterDetails meterDetails() { /** * Get the unitOfMeasure property: Unit of measure. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -110,7 +119,7 @@ public String unitOfMeasure() { /** * Get the includedQuantity property: Included quality for an offer. - * + * * @return the includedQuantity value. */ public BigDecimal includedQuantity() { @@ -119,7 +128,7 @@ public BigDecimal includedQuantity() { /** * Get the partNumber property: Part Number. - * + * * @return the partNumber value. */ public String partNumber() { @@ -128,7 +137,7 @@ public String partNumber() { /** * Get the unitPrice property: Unit Price. - * + * * @return the unitPrice value. */ public BigDecimal unitPrice() { @@ -137,7 +146,7 @@ public BigDecimal unitPrice() { /** * Get the currencyCode property: Currency Code. - * + * * @return the currencyCode value. */ public String currencyCode() { @@ -146,21 +155,33 @@ public String currencyCode() { /** * Get the offerId property: Offer Id. - * + * * @return the offerId value. */ public String offerId() { return this.offerId; } + /** + * Get the savingsPlan property: SavingsPlan Details. + * + * @return the savingsPlan value. + */ + public SavingsPlan savingsPlan() { + return this.savingsPlan; + } + /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (meterDetails() != null) { meterDetails().validate(); } + if (savingsPlan() != null) { + savingsPlan().validate(); + } } } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java index 1ee724071a48..28200ff470da 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheetResult.java @@ -8,67 +8,69 @@ import java.util.List; import java.util.Map; -/** An immutable client-side representation of PriceSheetResult. */ +/** + * An immutable client-side representation of PriceSheetResult. + */ public interface PriceSheetResult { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the pricesheets property: Price sheet. - * + * * @return the pricesheets value. */ List pricesheets(); /** * Gets the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ String nextLink(); /** * Gets the download property: Pricesheet download details. - * + * * @return the download value. */ MeterDetails download(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner object. - * + * * @return the inner object. */ PriceSheetResultInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/PriceSheets.java index 13bfc45db8b9..19203f1c6100 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 @@ -7,11 +7,30 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of PriceSheets. */ +/** + * 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. + * * @throws com.azure.core.management.exception.ManagementException 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. @@ -19,26 +38,29 @@ 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. + * 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. + * 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. + * @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 * for May 1, 2014 or later. - * + * * @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. @@ -48,22 +70,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 cb9d22a246d8..393987e407a4 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,20 +8,37 @@ 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. */ + /** + * Static value On Demand for PricingModelType. + */ public static final PricingModelType ON_DEMAND = fromString("On Demand"); - /** Static value Reservation for PricingModelType. */ + /** + * Static value Reservation for PricingModelType. + */ public static final PricingModelType RESERVATION = fromString("Reservation"); - /** Static value Spot for PricingModelType. */ + /** + * Static value Spot for PricingModelType. + */ public static final PricingModelType SPOT = fromString("Spot"); + /** + * Creates a new instance of PricingModelType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public PricingModelType() { + } + /** * Creates or finds a PricingModelType from its string representation. - * + * * @param name a name to look for. * @return the corresponding PricingModelType. */ @@ -30,7 +47,11 @@ public static PricingModelType fromString(String name) { return fromString(name, PricingModelType.class); } - /** @return known PricingModelType values. */ + /** + * Gets known PricingModelType values. + * + * @return known PricingModelType values. + */ public static Collection values() { return values(PricingModelType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Reseller.java index 029cada6fe01..df7f0d749a5d 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,13 @@ 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. */ +/** + * The reseller properties. + */ @Immutable public final class Reseller { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Reseller.class); - /* * The reseller property ID. */ @@ -26,9 +24,15 @@ 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. - * + * * @return the resellerId value. */ public String resellerId() { @@ -37,7 +41,7 @@ public String resellerId() { /** * Get the resellerDescription property: The reseller property description. - * + * * @return the resellerDescription value. */ public String resellerDescription() { @@ -46,7 +50,7 @@ public String resellerDescription() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java index 3ef807da985f..e4adeee8c566 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetail.java @@ -9,39 +9,41 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of ReservationDetail. */ +/** + * An immutable client-side representation of ReservationDetail. + */ public interface ReservationDetail { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -50,21 +52,21 @@ public interface ReservationDetail { * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ String reservationOrderId(); /** * Gets the instanceFlexibilityRatio property: The instance Flexibility Ratio. - * + * * @return the instanceFlexibilityRatio value. */ String instanceFlexibilityRatio(); /** * Gets the instanceFlexibilityGroup property: The instance Flexibility Group. - * + * * @return the instanceFlexibilityGroup value. */ String instanceFlexibilityGroup(); @@ -73,7 +75,7 @@ public interface ReservationDetail { * Gets the reservationId property: The reservation ID is the identifier of a reservation within a reservation * order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances * to which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ String reservationId(); @@ -81,7 +83,7 @@ public interface ReservationDetail { /** * Gets the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ String skuName(); @@ -89,28 +91,28 @@ public interface ReservationDetail { /** * Gets the reservedHours property: This is the total hours reserved for the day. E.g. if reservation for 1 instance * was made on 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ BigDecimal reservedHours(); /** * Gets the usageDate property: The date on which consumption occurred. - * + * * @return the usageDate value. */ OffsetDateTime usageDate(); /** * Gets the usedHours property: This is the total hours used by the instance. - * + * * @return the usedHours value. */ BigDecimal usedHours(); /** * Gets the instanceId property: This identifier is the name of the resource or the fully qualified Resource ID. - * + * * @return the instanceId value. */ String instanceId(); @@ -118,21 +120,21 @@ public interface ReservationDetail { /** * Gets the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ BigDecimal totalReservedQuantity(); /** * Gets the kind property: The reservation kind. - * + * * @return the kind value. */ String kind(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner object. - * + * * @return the inner object. */ ReservationDetailInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationDetailsListResult.java index ffb854c4b8ff..ee1d711bd3e8 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java index 6740c206fff4..1ca340907010 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendation.java @@ -7,60 +7,69 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner; import java.util.Map; -/** An immutable client-side representation of ReservationRecommendation. */ +/** + * An immutable client-side representation of ReservationRecommendation. + */ public interface ReservationRecommendation { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the kind property: Specifies the kind of reservation recommendation. + * + * @return the kind value. + */ + ReservationRecommendationKind kind(); + /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the location property: Resource location. - * + * * @return the location value. */ String location(); /** * Gets the sku property: Resource sku. - * + * * @return the sku value. */ String sku(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner object. - * + * * @return the inner object. */ ReservationRecommendationInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetails.java index 4c93fb135ef7..04113669b545 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 @@ -7,50 +7,56 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of ReservationRecommendationDetails. */ +/** + * Resource collection API of ReservationRecommendationDetails. + */ 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 - * '/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 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). + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). + * @param filter Used to filter reservation recommendation details by: properties/subscriptionId can be specified + * for billing account and billing profile paths. + * @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, String filter, 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 - * '/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 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. + * Standard_DS1_v2 (for VM), Premium_SSD_Managed_Disks_P30 (for Managed Disks). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 4810f2254a22..c32aea2cc20c 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,21 @@ 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,33 +31,38 @@ 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; /** - * Get the onDemandCost property: The cost without reservation. - * + * Creates an instance of ReservationRecommendationDetailsCalculatedSavingsProperties class. + */ + public ReservationRecommendationDetailsCalculatedSavingsProperties() { + } + + /** + * Get the onDemandCost property: The cost without reservation. Includes hardware and software cost. + * * @return the onDemandCost value. */ public Float onDemandCost() { @@ -69,8 +70,8 @@ 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. */ public Float overageCost() { @@ -79,7 +80,7 @@ public Float overageCost() { /** * Get the quantity property: The quantity for calculated savings. - * + * * @return the quantity value. */ public Float quantity() { @@ -87,8 +88,8 @@ 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. */ public Float reservationCost() { @@ -96,8 +97,9 @@ 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. */ public Float totalReservationCost() { @@ -107,7 +109,7 @@ public Float totalReservationCost() { /** * Get the reservedUnitCount property: The number of reserved units used to calculate savings. Always 1 for virtual * machines. - * + * * @return the reservedUnitCount value. */ public Float reservedUnitCount() { @@ -117,7 +119,7 @@ public Float reservedUnitCount() { /** * Set the reservedUnitCount property: The number of reserved units used to calculate savings. Always 1 for virtual * machines. - * + * * @param reservedUnitCount the reservedUnitCount value to set. * @return the ReservationRecommendationDetailsCalculatedSavingsProperties object itself. */ @@ -127,8 +129,9 @@ 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. */ public Float savings() { @@ -137,7 +140,7 @@ public Float savings() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java index b696fec5806f..f269b2e153f0 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsModel.java @@ -7,95 +7,97 @@ import com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner; import java.util.Map; -/** An immutable client-side representation of ReservationRecommendationDetailsModel. */ +/** + * An immutable client-side representation of ReservationRecommendationDetailsModel. + */ public interface ReservationRecommendationDetailsModel { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: Resource Location. - * + * * @return the location value. */ String location(); /** * Gets the sku property: Resource sku. - * + * * @return the sku value. */ String sku(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the currency property: An ISO 4217 currency code identifier for the costs and savings. - * + * * @return the currency value. */ String currency(); /** * Gets the resource property: Resource specific properties. - * + * * @return the resource value. */ ReservationRecommendationDetailsResourceProperties resource(); /** * Gets the resourceGroup property: Resource Group. - * + * * @return the resourceGroup value. */ String resourceGroup(); /** * Gets the savings property: Savings information for the recommendation. - * + * * @return the savings value. */ ReservationRecommendationDetailsSavingsProperties savings(); /** * Gets the scope property: Scope of the reservation, ex: Single or Shared. - * + * * @return the scope value. */ String scope(); /** * Gets the usage property: Historical usage details used to calculate the estimated savings. - * + * * @return the usage value. */ ReservationRecommendationDetailsUsageProperties usage(); @@ -103,7 +105,7 @@ public interface ReservationRecommendationDetailsModel { /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner * object. - * + * * @return the inner object. */ ReservationRecommendationDetailsModelInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsResourceProperties.java index 3835bf3903d9..0ec3257d632c 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,14 @@ 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. */ +/** + * 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 +20,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 +38,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,9 +49,15 @@ 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. - * + * * @return the appliedScopes value. */ public List appliedScopes() { @@ -62,8 +65,9 @@ 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. */ public Float onDemandRate() { @@ -72,7 +76,7 @@ public Float onDemandRate() { /** * Get the product property: Azure product ex: Standard_E8s_v3 etc. - * + * * @return the product value. */ public String product() { @@ -81,7 +85,7 @@ public String product() { /** * Get the region property: Azure resource region ex:EastUS, WestUS etc. - * + * * @return the region value. */ public String region() { @@ -89,8 +93,8 @@ 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. */ public Float reservationRate() { @@ -99,7 +103,7 @@ public Float reservationRate() { /** * Get the resourceType property: The azure resource type. - * + * * @return the resourceType value. */ public String resourceType() { @@ -108,7 +112,7 @@ public String resourceType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsSavingsProperties.java index 7753a58ff4e0..a524bab82032 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,14 @@ 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. */ +/** + * 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 +20,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,9 +49,15 @@ 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. - * + * * @return the calculatedSavings value. */ public List calculatedSavings() { @@ -64,19 +66,19 @@ public List calcula /** * Set the calculatedSavings property: List of calculated savings. - * + * * @param calculatedSavings the calculatedSavings value to set. * @return the ReservationRecommendationDetailsSavingsProperties object itself. */ - public ReservationRecommendationDetailsSavingsProperties withCalculatedSavings( - List calculatedSavings) { + public ReservationRecommendationDetailsSavingsProperties + withCalculatedSavings(List calculatedSavings) { this.calculatedSavings = calculatedSavings; return this; } /** * Get the lookBackPeriod property: Number of days of usage to look back used for computing the recommendation. - * + * * @return the lookBackPeriod value. */ public Integer lookBackPeriod() { @@ -85,7 +87,7 @@ public Integer lookBackPeriod() { /** * Get the recommendedQuantity property: Number of recommended units of the resource. - * + * * @return the recommendedQuantity value. */ public Float recommendedQuantity() { @@ -94,7 +96,7 @@ public Float recommendedQuantity() { /** * Get the reservationOrderTerm property: Term period of the reservation, ex: P1Y or P3Y. - * + * * @return the reservationOrderTerm value. */ public String reservationOrderTerm() { @@ -103,7 +105,7 @@ public String reservationOrderTerm() { /** * Get the savingsType property: Type of savings, ex: instance. - * + * * @return the savingsType value. */ public String savingsType() { @@ -112,7 +114,7 @@ public String savingsType() { /** * Get the unitOfMeasure property: Measurement unit ex: hour etc. - * + * * @return the unitOfMeasure value. */ public String unitOfMeasure() { @@ -121,7 +123,7 @@ public String unitOfMeasure() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationDetailsUsageProperties.java index 76d401214b2f..e2c3c688b426 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,22 @@ 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. */ +/** + * 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 +32,7 @@ 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,10 +43,16 @@ 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. - * + * * @return the firstConsumptionDate value. */ public String firstConsumptionDate() { @@ -61,7 +61,7 @@ public String firstConsumptionDate() { /** * Get the lastConsumptionDate property: The last usage date used for looking back for computing the recommendation. - * + * * @return the lastConsumptionDate value. */ public String lastConsumptionDate() { @@ -70,7 +70,7 @@ public String lastConsumptionDate() { /** * Get the lookBackUnitType property: What the usage data values represent ex: virtual machine instance. - * + * * @return the lookBackUnitType value. */ public String lookBackUnitType() { @@ -80,7 +80,7 @@ public String lookBackUnitType() { /** * Get the usageData property: The breakdown of historical resource usage. The values are in the order of usage * between the firstConsumptionDate and the lastConsumptionDate. - * + * * @return the usageData value. */ public List usageData() { @@ -89,7 +89,7 @@ public List usageData() { /** * Get the usageGrain property: The grain of the values represented in the usage data ex: hourly. - * + * * @return the usageGrain value. */ public String usageGrain() { @@ -98,7 +98,7 @@ public String usageGrain() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationKind.java index 0111aee932c5..8a87123586c7 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,17 +8,32 @@ 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. */ + /** + * Static value legacy for ReservationRecommendationKind. + */ public static final ReservationRecommendationKind LEGACY = fromString("legacy"); - /** Static value modern for ReservationRecommendationKind. */ + /** + * Static value modern for ReservationRecommendationKind. + */ public static final ReservationRecommendationKind MODERN = fromString("modern"); + /** + * Creates a new instance of ReservationRecommendationKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ReservationRecommendationKind() { + } + /** * Creates or finds a ReservationRecommendationKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding ReservationRecommendationKind. */ @@ -27,7 +42,11 @@ public static ReservationRecommendationKind fromString(String name) { return fromString(name, ReservationRecommendationKind.class); } - /** @return known ReservationRecommendationKind values. */ + /** + * Gets known ReservationRecommendationKind values. + * + * @return known ReservationRecommendationKind values. + */ public static Collection values() { return values(ReservationRecommendationKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendations.java index adae056eabfe..46527a768b58 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 @@ -7,44 +7,46 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of ReservationRecommendations. */ +/** + * Resource collection API of ReservationRecommendations. + */ public interface ReservationRecommendations { /** * List of recommendations for purchasing reserved instances. - * - * @param scope 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 - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * billingProfile scope. + * + * @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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile 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 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 - * '/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 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 + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * billingProfile scope. * @param filter May be used to filter reservationRecommendations by: properties/scope with allowed values - * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values - * ['VirtualMachines', 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', - * 'CosmosDB', 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', - * 'VMwareCloudSimple'] and default value 'VirtualMachines'; and properties/lookBackPeriod with allowed values - * ['Last7Days', 'Last30Days', 'Last60Days'] and default value 'Last7Days'. + * ['Single', 'Shared'] and default value 'Single'; properties/resourceType with allowed values ['VirtualMachines', + * 'SQLDatabases', 'PostgreSQL', 'ManagedDisk', 'MySQL', 'RedHat', 'MariaDB', 'RedisCache', 'CosmosDB', + * 'SqlDataWarehouse', 'SUSELinux', 'AppService', 'BlockBlob', 'AzureDataExplorer', 'VMwareCloudSimple'] and default + * value 'VirtualMachines'; and properties/lookBackPeriod with allowed values ['Last7Days', 'Last30Days', + * 'Last60Days'] and default value 'Last7Days'. * @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 scope, String filter, Context context); + PagedIterable list(String resourceScope, String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationRecommendationsListResult.java index 5de354242a73..2840f6a289e6 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,15 @@ 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. */ +/** + * 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,9 +32,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -45,7 +49,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -54,7 +58,7 @@ public String nextLink() { /** * Get the previousLink property: The link (url) to the previous page of results. - * + * * @return the previousLink value. */ public String previousLink() { @@ -63,7 +67,7 @@ public String previousLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummariesListResult.java index e355ec17c10d..aa6db4addaa2 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java index b48e0e8e43e0..04c72499ff41 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationSummary.java @@ -9,39 +9,41 @@ import java.time.OffsetDateTime; import java.util.Map; -/** An immutable client-side representation of ReservationSummary. */ +/** + * An immutable client-side representation of ReservationSummary. + */ public interface ReservationSummary { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); @@ -50,7 +52,7 @@ public interface ReservationSummary { * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ String reservationOrderId(); @@ -59,7 +61,7 @@ public interface ReservationSummary { * Gets the reservationId property: The reservation ID is the identifier of a reservation within a reservation * order. Each reservation is the grouping for applying the benefit scope and also specifies the number of instances * to which the reservation benefit can be applied to. - * + * * @return the reservationId value. */ String reservationId(); @@ -67,7 +69,7 @@ public interface ReservationSummary { /** * Gets the skuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the skuName value. */ String skuName(); @@ -75,7 +77,7 @@ public interface ReservationSummary { /** * Gets the reservedHours property: This is the total hours reserved. E.g. if reservation for 1 instance was made on * 1 PM, this will be 11 hours for that day and 24 hours from subsequent days. - * + * * @return the reservedHours value. */ BigDecimal reservedHours(); @@ -83,14 +85,14 @@ public interface ReservationSummary { /** * Gets the usageDate property: Data corresponding to the utilization record. If the grain of data is monthly, it * will be first day of month. - * + * * @return the usageDate value. */ OffsetDateTime usageDate(); /** * Gets the usedHours property: Total used hours by the reservation. - * + * * @return the usedHours value. */ BigDecimal usedHours(); @@ -99,7 +101,7 @@ public interface ReservationSummary { * Gets the minUtilizationPercentage property: This is the minimum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 10%, this * field will return 10% for that day. - * + * * @return the minUtilizationPercentage value. */ BigDecimal minUtilizationPercentage(); @@ -107,7 +109,7 @@ public interface ReservationSummary { /** * Gets the avgUtilizationPercentage property: This is average utilization for the entire time range. (day or month * depending on the grain). - * + * * @return the avgUtilizationPercentage value. */ BigDecimal avgUtilizationPercentage(); @@ -116,28 +118,28 @@ public interface ReservationSummary { * Gets the maxUtilizationPercentage property: This is the maximum hourly utilization in the usage time (day or * month). E.g. if usage record corresponds to 12/10/2017 and on that for hour 4 and 5, utilization was 100%, this * field will return 100% for that day. - * + * * @return the maxUtilizationPercentage value. */ BigDecimal maxUtilizationPercentage(); /** * Gets the kind property: The reservation kind. - * + * * @return the kind value. */ String kind(); /** * Gets the purchasedQuantity property: This is the purchased quantity for the reservationId. - * + * * @return the purchasedQuantity value. */ BigDecimal purchasedQuantity(); /** * Gets the remainingQuantity property: This is the remaining quantity for the reservationId. - * + * * @return the remainingQuantity value. */ BigDecimal remainingQuantity(); @@ -145,28 +147,28 @@ public interface ReservationSummary { /** * Gets the totalReservedQuantity property: This is the total count of instances that are reserved for the * reservationId. - * + * * @return the totalReservedQuantity value. */ BigDecimal totalReservedQuantity(); /** * Gets the usedQuantity property: This is the used quantity for the reservationId. - * + * * @return the usedQuantity value. */ BigDecimal usedQuantity(); /** * Gets the utilizedPercentage property: This is the utilized percentage for the reservation Id. - * + * * @return the utilizedPercentage value. */ BigDecimal utilizedPercentage(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner object. - * + * * @return the inner object. */ ReservationSummaryInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransaction.java index c5f47052b779..9026b66f6d65 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 @@ -10,39 +10,41 @@ import java.util.List; import java.util.UUID; -/** An immutable client-side representation of ReservationTransaction. */ +/** + * An immutable client-side representation of ReservationTransaction. + */ public interface ReservationTransaction { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ List tags(); /** * Gets the eventDate property: The date of the transaction. - * + * * @return the eventDate value. */ OffsetDateTime eventDate(); @@ -51,70 +53,70 @@ public interface ReservationTransaction { * Gets the reservationOrderId property: The reservation order ID is the identifier for a reservation purchase. Each * reservation order ID represents a single purchase transaction. A reservation order contains reservations. The * reservation order specifies the VM size and region for the reservations. - * + * * @return the reservationOrderId value. */ String reservationOrderId(); /** * Gets the description property: The description of the transaction. - * + * * @return the description value. */ 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. */ String eventType(); /** * Gets the quantity property: The quantity of the transaction. - * + * * @return the quantity value. */ BigDecimal quantity(); /** * Gets the amount property: The charge of the transaction. - * + * * @return the amount value. */ BigDecimal amount(); /** * Gets the currency property: The ISO currency in which the transaction is charged, for example, USD. - * + * * @return the currency value. */ String currency(); /** * Gets the reservationOrderName property: The name of the reservation order. - * + * * @return the reservationOrderName value. */ String reservationOrderName(); /** * Gets the purchasingEnrollment property: The purchasing enrollment. - * + * * @return the purchasingEnrollment value. */ String purchasingEnrollment(); /** * Gets the purchasingSubscriptionGuid property: The subscription guid that makes the transaction. - * + * * @return the purchasingSubscriptionGuid value. */ UUID purchasingSubscriptionGuid(); /** * Gets the purchasingSubscriptionName property: The subscription name that makes the transaction. - * + * * @return the purchasingSubscriptionName value. */ String purchasingSubscriptionName(); @@ -122,42 +124,42 @@ public interface ReservationTransaction { /** * Gets the armSkuName property: This is the ARM Sku name. It can be used to join with the serviceType field in * additional info in usage records. - * + * * @return the armSkuName value. */ String armSkuName(); /** * Gets the term property: This is the term of the transaction. - * + * * @return the term value. */ String term(); /** * Gets the region property: The region of the transaction. - * + * * @return the region value. */ String region(); /** * Gets the accountName property: The name of the account that makes the transaction. - * + * * @return the accountName value. */ String accountName(); /** * Gets the accountOwnerEmail property: The email of the account owner that makes the transaction. - * + * * @return the accountOwnerEmail value. */ String accountOwnerEmail(); /** * Gets the departmentName property: The department name. - * + * * @return the departmentName value. */ String departmentName(); @@ -165,49 +167,49 @@ public interface ReservationTransaction { /** * Gets the costCenter property: The cost center of this department if it is a department and a cost center is * provided. - * + * * @return the costCenter value. */ String costCenter(); /** * Gets the currentEnrollment property: The current enrollment. - * + * * @return the currentEnrollment value. */ String currentEnrollment(); /** * Gets the billingFrequency property: The billing frequency, which can be either one-time or recurring. - * + * * @return the billingFrequency value. */ String billingFrequency(); /** * Gets the billingMonth property: The billing month(yyyyMMdd), on which the event initiated. - * + * * @return the billingMonth value. */ Integer billingMonth(); /** * Gets the monetaryCommitment property: The monetary commitment amount at the enrollment scope. - * + * * @return the monetaryCommitment value. */ BigDecimal monetaryCommitment(); /** * Gets the overage property: The overage amount at the enrollment scope. - * + * * @return the overage value. */ BigDecimal overage(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner object. - * + * * @return the inner object. */ ReservationTransactionInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionResource.java index 16d5361a2471..37e49b6affb1 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,25 +6,29 @@ 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. */ +/** + * 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. - * + * * @return the tags value. */ public List tags() { @@ -33,7 +37,7 @@ public List tags() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactions.java index 5fc85b543a97..c4e24ebe7d1f 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,59 +6,85 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; +import java.math.BigDecimal; -/** Resource collection API of ReservationTransactions. */ +/** + * 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); + PagedIterable listByBillingProfile(String billingAccountId, String billingProfileId, + String filter, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationTransactionsListResult.java index f79c313d6d23..7db31e234215 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,15 @@ 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. */ +/** + * 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,9 +26,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -39,7 +43,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -48,7 +52,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsDetails.java index 0bc6bc3f035a..a2f80b3f836a 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 @@ -7,107 +7,127 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of ReservationsDetails. */ +/** + * 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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 - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if 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); + 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. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. + * filter supports 'le' and 'ge'. * @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 details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ - PagedIterable listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, String filter, Context context); + PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, String filter, Context context); /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope 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). + * 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 resourceScope The scope associated with reservations details operations. This includes + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for + * BillingProfile scope (modern). * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing reservation details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ - PagedIterable list(String scope); + PagedIterable list(String resourceScope); /** - * Lists the reservations details for the defined scope and provided date range. - * - * @param scope The scope associated with reservations details operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Filter reservation details by date range. The properties/UsageDate for start date and end date. The - * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. + * filter supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 details. + * @return result of listing reservation details as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String scope, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context); + PagedIterable list(String resourceScope, String startDate, String endDate, String filter, + String reservationId, String reservationOrderId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ReservationsSummaries.java index a5c07b494c6c..cfbaa0f76c01 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 @@ -7,111 +7,118 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of ReservationsSummaries. */ +/** + * 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. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ - PagedIterable listByReservationOrder( - String reservationOrderId, Datagrain grain, String filter, Context context); + 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. * @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 listByReservationOrderAndReservation( - String reservationOrderId, String reservationId, Datagrain grain); + 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. * @param grain Can be daily or monthly. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. + * supports 'le' and 'ge'. * @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 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); + PagedIterable listByReservationOrderAndReservation(String reservationOrderId, + String reservationId, Datagrain grain, String filter, Context context); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope 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). + * 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 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). * @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 list(String scope, Datagrain grain); + PagedIterable list(String resourceScope, Datagrain grain); /** - * Lists the reservations summaries for the defined scope daily or monthly grain. - * - * @param scope The scope associated with reservations summaries operations. This includes - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for BillingAccount scope (legacy), and - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for - * BillingProfile scope (modern). + * 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 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). * @param grain Can be daily or monthly. * @param startDate Start date. Only applicable when querying with billing profile. * @param endDate End date. Only applicable when querying with billing profile. * @param filter Required only for daily grain. The properties/UsageDate for start date and end date. The filter - * supports 'le' and 'ge'. Not applicable when querying with billing profile. + * supports 'le' and 'ge'. Not applicable when querying with billing profile. * @param reservationId Reservation Id GUID. Only valid if reservationOrderId is also provided. Filter to a specific - * reservation. + * reservation. * @param reservationOrderId Reservation Order Id GUID. Required if reservationId is provided. Filter to a specific - * reservation order. + * reservation order. * @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 summaries. + * @return result of listing reservation summaries as paginated response with {@link PagedIterable}. */ - PagedIterable list( - String scope, - Datagrain grain, - String startDate, - String endDate, - String filter, - String reservationId, - String reservationOrderId, - Context context); + PagedIterable list(String resourceScope, Datagrain grain, String startDate, String endDate, + String filter, String reservationId, String reservationOrderId, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ResourceAttributes.java index 267f6e808f6a..bf1092fb612b 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,13 @@ 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. */ +/** + * The Resource model definition. + */ @Immutable public class ResourceAttributes { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceAttributes.class); - /* * Resource location */ @@ -26,9 +24,15 @@ 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. - * + * * @return the location value. */ public String location() { @@ -37,7 +41,7 @@ public String location() { /** * Get the sku property: Resource sku. - * + * * @return the sku value. */ public String sku() { @@ -46,7 +50,7 @@ public String sku() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SavingsPlan.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SavingsPlan.java new file mode 100644 index 000000000000..195f54da2980 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/SavingsPlan.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.models; + +import com.azure.core.annotation.Immutable; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.math.BigDecimal; + +/** + * The properties of the SavingsPlan. + */ +@Immutable +public final class SavingsPlan { + /* + * SavingsPlan term + */ + @JsonProperty(value = "term", access = JsonProperty.Access.WRITE_ONLY) + private String term; + + /* + * SavingsPlan Market Price + */ + @JsonProperty(value = "marketPrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal marketPrice; + + /* + * SavingsPlan Effective Price + */ + @JsonProperty(value = "effectivePrice", access = JsonProperty.Access.WRITE_ONLY) + private BigDecimal effectivePrice; + + /** + * Creates an instance of SavingsPlan class. + */ + public SavingsPlan() { + } + + /** + * Get the term property: SavingsPlan term. + * + * @return the term value. + */ + public String term() { + return this.term; + } + + /** + * Get the marketPrice property: SavingsPlan Market Price. + * + * @return the marketPrice value. + */ + public BigDecimal marketPrice() { + return this.marketPrice; + } + + /** + * Get the effectivePrice property: SavingsPlan Effective Price. + * + * @return the effectivePrice value. + */ + public BigDecimal effectivePrice() { + return this.effectivePrice; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java new file mode 100644 index 000000000000..9f2af26307d4 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Scope.java @@ -0,0 +1,53 @@ +// 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 5f4126be7535..b7e809506c77 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,13 @@ 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. */ +/** + * The Sku property. + */ @Immutable public final class SkuProperty { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SkuProperty.class); - /* * The name of sku property. */ @@ -26,9 +24,15 @@ 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. - * + * * @return the name value. */ public String name() { @@ -37,7 +41,7 @@ public String name() { /** * Get the value property: The value of sku property. - * + * * @return the value value. */ public String value() { @@ -46,7 +50,7 @@ public String value() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Status.java index be3cc4f3b945..928eb08c4b6d 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,29 +8,52 @@ 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. */ + /** + * Static value None for Status. + */ public static final Status NONE = fromString("None"); - /** Static value Active for Status. */ + /** + * Static value Active for Status. + */ public static final Status ACTIVE = fromString("Active"); - /** Static value Inactive for Status. */ + /** + * Static value Inactive for Status. + */ public static final Status INACTIVE = fromString("Inactive"); - /** Static value Expired for Status. */ + /** + * Static value Expired for Status. + */ public static final Status EXPIRED = fromString("Expired"); - /** Static value Complete for Status. */ + /** + * Static value Complete for Status. + */ public static final Status COMPLETE = fromString("Complete"); - /** Static value Canceled for Status. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding Status. */ @@ -39,7 +62,11 @@ public static Status fromString(String name) { return fromString(name, Status.class); } - /** @return known Status values. */ + /** + * Gets known Status values. + * + * @return known Status values. + */ public static Collection values() { return values(Status.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tag.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tag.java index 1c6eaf790788..ac8756c603cb 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,14 @@ 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. */ +/** + * The tag resource. + */ @Fluent public final class Tag { - @JsonIgnore private final ClientLogger logger = new ClientLogger(Tag.class); - /* * Tag key. */ @@ -27,9 +25,15 @@ public final class Tag { @JsonProperty(value = "value") private List value; + /** + * Creates an instance of Tag class. + */ + public Tag() { + } + /** * Get the key property: Tag key. - * + * * @return the key value. */ public String key() { @@ -38,7 +42,7 @@ public String key() { /** * Set the key property: Tag key. - * + * * @param key the key value to set. * @return the Tag object itself. */ @@ -49,7 +53,7 @@ public Tag withKey(String key) { /** * Get the value property: Tag values. - * + * * @return the value value. */ public List value() { @@ -58,7 +62,7 @@ public List value() { /** * Set the value property: Tag values. - * + * * @param value the value value to set. * @return the Tag object itself. */ @@ -69,7 +73,7 @@ public Tag withValue(List value) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Tags.java index 45decbb6eebb..152b2071b9b6 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 @@ -7,42 +7,42 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Tags. */ +/** + * Resource collection API of Tags. + */ public interface Tags { /** * Get all available tag keys for the defined scope. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' - * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for - * Management Group scope.. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * 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 com.azure.core.management.exception.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. - * + * * @param scope The scope associated with tags operations. This includes '/subscriptions/{subscriptionId}/' for - * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup - * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, - * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department - * 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. + * subscription scope, '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department + * scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' + * for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for + * Management Group 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 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/TagsResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java index 779096aff19a..9c9c76b3db7e 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TagsResult.java @@ -7,25 +7,27 @@ import com.azure.resourcemanager.consumption.fluent.models.TagsResultInner; import java.util.List; -/** An immutable client-side representation of TagsResult. */ +/** + * An immutable client-side representation of TagsResult. + */ public interface TagsResult { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); @@ -33,35 +35,35 @@ public interface TagsResult { /** * Gets the etag property: eTag of the resource. To handle concurrent update scenario, this field will be used to * determine whether the user is updating the latest version or not. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: A list of Tag. - * + * * @return the tags value. */ List tags(); /** * Gets the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ String nextLink(); /** * Gets the previousLink property: The link (url) to the previous page of results. - * + * * @return the previousLink value. */ String previousLink(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.TagsResultInner object. - * + * * @return the inner object. */ TagsResultInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/Term.java index bf14eb811c57..c30860895351 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 @@ -8,17 +8,32 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for Term. */ +/** + * Defines values for Term. + */ public final class Term extends ExpandableStringEnum { - /** Static value P1Y for Term. */ + /** + * Static value P1Y for Term. + */ public static final Term P1Y = fromString("P1Y"); - /** Static value P3Y for Term. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding Term. */ @@ -27,7 +42,11 @@ public static Term fromString(String name) { return fromString(name, Term.class); } - /** @return known Term values. */ + /** + * Gets known Term values. + * + * @return known Term values. + */ public static Collection values() { return values(Term.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/ThresholdType.java index f1a1ee1bb85c..95e8d311a6f4 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,17 +8,32 @@ 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. */ + /** + * Static value Actual for ThresholdType. + */ public static final ThresholdType ACTUAL = fromString("Actual"); - /** Static value Forecasted for ThresholdType. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding ThresholdType. */ @@ -27,7 +42,11 @@ public static ThresholdType fromString(String name) { return fromString(name, ThresholdType.class); } - /** @return known ThresholdType values. */ + /** + * Gets known ThresholdType values. + * + * @return known ThresholdType values. + */ public static Collection values() { return values(ThresholdType.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/TimeGrainType.java index 2da37ebc4ab5..5e083cd7949d 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,29 +8,53 @@ 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. */ + /** + * Static value Monthly for TimeGrainType. + */ public static final TimeGrainType MONTHLY = fromString("Monthly"); - /** Static value Quarterly for TimeGrainType. */ + /** + * Static value Quarterly for TimeGrainType. + */ public static final TimeGrainType QUARTERLY = fromString("Quarterly"); - /** Static value Annually for TimeGrainType. */ + /** + * Static value Annually for TimeGrainType. + */ public static final TimeGrainType ANNUALLY = fromString("Annually"); - /** Static value BillingMonth for TimeGrainType. */ + /** + * Static value BillingMonth for TimeGrainType. + */ public static final TimeGrainType BILLING_MONTH = fromString("BillingMonth"); - /** Static value BillingQuarter for TimeGrainType. */ + /** + * Static value BillingQuarter for TimeGrainType. + */ public static final TimeGrainType BILLING_QUARTER = fromString("BillingQuarter"); - /** Static value BillingAnnual for TimeGrainType. */ + /** + * 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. - * + * * @param name a name to look for. * @return the corresponding TimeGrainType. */ @@ -39,7 +63,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/UsageDetail.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java index f79d6b457641..ff939853a7ac 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetail.java @@ -7,46 +7,55 @@ import com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner; import java.util.Map; -/** An immutable client-side representation of UsageDetail. */ +/** + * An immutable client-side representation of UsageDetail. + */ public interface UsageDetail { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); + /** + * Gets the kind property: Specifies the kind of usage details. + * + * @return the kind value. + */ + UsageDetailsKind kind(); + /** * Gets the etag property: The etag for the resource. - * + * * @return the etag value. */ String etag(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** * Gets the inner com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner object. - * + * * @return the inner object. */ UsageDetailInner innerModel(); diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetails.java index 61734c007e49..5ee656c930a3 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 @@ -7,75 +7,87 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of UsageDetails. */ +/** + * Resource collection API of UsageDetails. + */ 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return result of listing usage details. + * @return result of listing usage details as paginated response with {@link PagedIterable}. */ 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, - * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and - * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For - * subscription, billing account, department, enrollment account and management group, 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/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}' - * for invoiceSection scope, and - * 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for - * partners. + * for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account + * scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, + * '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and + * '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For + * subscription, billing account, department, enrollment account and management group, 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/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}' + * for invoiceSection scope, and + * '/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. + * usage details. By default, these fields are not included when listing usage details. * @param filter May be used to filter usageDetails by properties/resourceGroup, properties/resourceName, - * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The - * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. - * Tag filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter - * accepts two values azure and marketplace and it is currently supported for Web Direct Offer Type. + * properties/resourceId, properties/chargeType, properties/reservationId, properties/publisherType or tags. The + * filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. It does not currently support 'ne', 'or', or 'not'. Tag + * filter is a key value pair string where key and value is separated by a colon (:). PublisherType Filter accepts + * two values azure and marketplace and it is currently supported for Web Direct Offer Type. * @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. + * contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that specifies + * a starting point to use for subsequent calls. * @param top May be used to limit the number of results to the most recent N usageDetails. * @param metric Allows to select different type of cost/usage records. * @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 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); + PagedIterable list(String scope, String expand, String filter, String skiptoken, Integer top, + Metrictype metric, Context context); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsKind.java index 7f77f761d22c..b9685ac7dbdb 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,17 +8,32 @@ 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. */ + /** + * Static value legacy for UsageDetailsKind. + */ public static final UsageDetailsKind LEGACY = fromString("legacy"); - /** Static value modern for UsageDetailsKind. */ + /** + * Static value modern for UsageDetailsKind. + */ public static final UsageDetailsKind MODERN = fromString("modern"); + /** + * Creates a new instance of UsageDetailsKind value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsageDetailsKind() { + } + /** * Creates or finds a UsageDetailsKind from its string representation. - * + * * @param name a name to look for. * @return the corresponding UsageDetailsKind. */ @@ -27,7 +42,11 @@ public static UsageDetailsKind fromString(String name) { return fromString(name, UsageDetailsKind.class); } - /** @return known UsageDetailsKind values. */ + /** + * Gets known UsageDetailsKind values. + * + * @return known UsageDetailsKind values. + */ public static Collection values() { return values(UsageDetailsKind.class); } diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/UsageDetailsListResult.java index 928d9f1da0c3..f97214cf6b58 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,9 +27,15 @@ 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. - * + * * @return the value value. */ public List value() { @@ -42,7 +44,7 @@ public List value() { /** * Get the nextLink property: The link (url) to the next page of results. - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/package-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/package-info.java index 533ca7ef1932..112d3f5fc60a 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/package-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for ConsumptionManagementClient. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * Package containing the data models for ConsumptionManagementClient. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.consumption.models; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/package-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/package-info.java index b981ed0be5bc..e100d5faf8ca 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/package-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/com/azure/resourcemanager/consumption/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for ConsumptionManagementClient. Consumption management client provides access to - * consumption resources for Azure Enterprise Subscriptions. + * Package containing the classes for ConsumptionManagementClient. + * Consumption management client provides access to consumption resources for Azure Enterprise Subscriptions. */ package com.azure.resourcemanager.consumption; diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/module-info.java b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/module-info.java index e5b5ff5af998..55ec74badfd6 100644 --- a/sdk/consumption/azure-resourcemanager-consumption/src/main/java/module-info.java +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/java/module-info.java @@ -4,16 +4,10 @@ module com.azure.resourcemanager.consumption { requires transitive com.azure.core.management; - exports com.azure.resourcemanager.consumption; exports com.azure.resourcemanager.consumption.fluent; exports com.azure.resourcemanager.consumption.fluent.models; exports com.azure.resourcemanager.consumption.models; - - opens com.azure.resourcemanager.consumption.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.consumption.models to - com.azure.core, - com.fasterxml.jackson.databind; -} + opens com.azure.resourcemanager.consumption.fluent.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.consumption.models to com.azure.core, com.fasterxml.jackson.databind; +} \ No newline at end of file diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/proxy-config.json b/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/proxy-config.json new file mode 100644 index 000000000000..132cfa916a52 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.consumption.implementation.UsageDetailsClientImpl$UsageDetailsService" ], [ "com.azure.resourcemanager.consumption.implementation.MarketplacesClientImpl$MarketplacesService" ], [ "com.azure.resourcemanager.consumption.implementation.BudgetsClientImpl$BudgetsService" ], [ "com.azure.resourcemanager.consumption.implementation.TagsClientImpl$TagsService" ], [ "com.azure.resourcemanager.consumption.implementation.ChargesClientImpl$ChargesService" ], [ "com.azure.resourcemanager.consumption.implementation.BalancesClientImpl$BalancesService" ], [ "com.azure.resourcemanager.consumption.implementation.ReservationsSummariesClientImpl$ReservationsSummariesService" ], [ "com.azure.resourcemanager.consumption.implementation.ReservationsDetailsClientImpl$ReservationsDetailsService" ], [ "com.azure.resourcemanager.consumption.implementation.ReservationRecommendationsClientImpl$ReservationRecommendationsService" ], [ "com.azure.resourcemanager.consumption.implementation.ReservationRecommendationDetailsClientImpl$ReservationRecommendationDetailsService" ], [ "com.azure.resourcemanager.consumption.implementation.ReservationTransactionsClientImpl$ReservationTransactionsService" ], [ "com.azure.resourcemanager.consumption.implementation.PriceSheetsClientImpl$PriceSheetsService" ], [ "com.azure.resourcemanager.consumption.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.consumption.implementation.AggregatedCostsClientImpl$AggregatedCostsService" ], [ "com.azure.resourcemanager.consumption.implementation.EventsOperationsClientImpl$EventsOperationsService" ], [ "com.azure.resourcemanager.consumption.implementation.LotsOperationsClientImpl$LotsOperationsService" ], [ "com.azure.resourcemanager.consumption.implementation.CreditsClientImpl$CreditsService" ] ] \ No newline at end of file diff --git a/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/reflect-config.json b/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/reflect-config.json new file mode 100644 index 000000000000..b37df89a4ef7 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-consumption/reflect-config.json @@ -0,0 +1,551 @@ +[ { + "name" : "com.azure.resourcemanager.consumption.models.UsageDetailsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.UsageDetailInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.MarketplacesListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.MarketplaceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.MarketplaceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.BudgetInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.BudgetProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetTimePeriod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetFilter", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetFilterProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetComparisonExpression", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.CurrentSpend", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Notification", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ForecastSpend", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.TagsResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.TagProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Tag", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ChargesListResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ChargeSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.BalanceInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.BalanceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BalancePropertiesNewPurchasesDetailsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BalancePropertiesAdjustmentDetailsItem", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationSummariesListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationSummaryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationDetailsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationDetailInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationDetailProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ResourceAttributes", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsModelInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationRecommendationDetailsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsResourceProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsSavingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsCalculatedSavingsProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationDetailsUsageProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationTransactionsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ReservationTransactionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.LegacyReservationTransactionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationTransactionResource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernReservationTransactionsListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ModernReservationTransactionProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.PriceSheetResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.PriceSheetModel", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.PriceSheetProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.MeterDetails", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.SavingsPlan", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.OperationListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.OperationInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.OperationDisplay", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostResultInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ManagementGroupAggregatedCostProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Events", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.EventSummaryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.EventProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Amount", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Reseller", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.AmountWithExchangeRate", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Lots", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.LotSummaryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.LotProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.CreditSummaryInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.CreditSummaryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.CreditBalanceSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.OperationStatusInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.PricesheetDownloadProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacyUsageDetail", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.LegacyUsageDetailProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.MeterDetailsResponse", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernUsageDetail", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ModernUsageDetailProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacyReservationRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacyReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.SkuProperty", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacySingleScopeReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacySharedScopeReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernReservationRecommendation", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernSingleScopeReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernSharedScopeReservationRecommendationProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacyReservationTransaction", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LegacyChargeSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.LegacyChargeSummaryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ModernChargeSummary", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.fluent.models.ModernChargeSummaryProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Metrictype", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.UsageDetailsKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.CategoryType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.TimeGrainType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BudgetOperatorType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.OperatorType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ThresholdType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.CultureCode", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ChargeSummaryKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.BillingFrequency", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Datagrain", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.ReservationRecommendationKind", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Scope", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Term", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LookBackPeriod", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.EventType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.LotSource", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.Status", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.OrganizationType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.OperationStatusType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.consumption.models.PricingModelType", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +} ] \ No newline at end of file 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 fbea8d1490c7..8e5f96a9e805 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,38 +4,37 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for AggregatedCost GetByManagementGroup. */ +/** + * 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-11-01/examples/AggregatedCostByManagementGroupFilterByDate.json */ /** * Sample code: AggregatedCostByManagementGroupFilterByDate. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void aggregatedCostByManagementGroupFilterByDate( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .aggregatedCosts() - .getByManagementGroupWithResponse( - "managementGroupForTest", + public static void + aggregatedCostByManagementGroupFilterByDate(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.aggregatedCosts() + .getByManagementGroupWithResponse("managementGroupForTest", "usageStart ge '2018-08-15' and properties/usageStart le '2018-08-31'", - Context.NONE); + 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-11-01/examples/AggregatedCostByManagementGroup.json */ /** * Sample code: AggregatedCostByManagementGroup. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void aggregatedCostByManagementGroup( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.aggregatedCosts().getByManagementGroupWithResponse("managementGroupForTest", null, Context.NONE); + public static void + aggregatedCostByManagementGroup(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + 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 f9e11290b568..471d3ebba795 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,22 +4,22 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for AggregatedCost GetForBillingPeriodByManagementGroup. */ +/** + * 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-11-01/examples/AggregatedCostForBillingPeriodByManagementGroup.json */ /** * Sample code: AggregatedCostListForBillingPeriodByManagementGroup. - * + * * @param manager Entry point to ConsumptionManager. */ public static void aggregatedCostListForBillingPeriodByManagementGroup( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .aggregatedCosts() - .getForBillingPeriodByManagementGroupWithResponse("managementGroupForTest", "201807", Context.NONE); + manager.aggregatedCosts() + .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 4b788fd036c6..84f8b1da94bd 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,19 +4,19 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Balances GetByBillingAccount. */ +/** + * 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-11-01/examples/BalancesByBillingAccount.json */ /** * Sample code: Balances. - * + * * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getByBillingAccountWithResponse("123456", Context.NONE); + 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 4d6ec139a0a8..b414e5c777d2 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,19 +4,20 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Balances GetForBillingPeriodByBillingAccount. */ +/** + * 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-11-01/examples/BalancesByBillingAccountForBillingPeriod.json */ /** * Sample code: Balances. - * + * * @param manager Entry point to ConsumptionManager. */ public static void balances(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.balances().getForBillingPeriodByBillingAccountWithResponse("123456", "201702", Context.NONE); + 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 c76451dc14ee..ae0d9226e46c 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 @@ -21,74 +21,53 @@ import java.util.HashMap; import java.util.Map; -/** Samples for Budgets CreateOrUpdate. */ +/** + * 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-11-01/examples/CreateOrUpdateBudget.json */ /** * Sample code: CreateOrUpdateBudget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void createOrUpdateBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() + manager.budgets() .define("TestBudget") .withExistingScope("subscriptions/00000000-0000-0000-0000-000000000000") .withEtag("\"1d34d016a593709\"") .withCategory(CategoryType.COST) .withAmount(new BigDecimal("100.65")) .withTimeGrain(TimeGrainType.MONTHLY) - .withTimePeriod( - new BudgetTimePeriod() - .withStartDate(OffsetDateTime.parse("2017-10-01T00:00:00Z")) - .withEndDate(OffsetDateTime.parse("2018-10-31T00:00:00Z"))) - .withFilter( - new BudgetFilter() - .withAnd( - Arrays - .asList( - new BudgetFilterProperties() - .withDimensions( - new BudgetComparisonExpression() - .withName("ResourceId") - .withOperator(BudgetOperatorType.IN) - .withValues( - Arrays - .asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), - new BudgetFilterProperties() - .withTags( - new BudgetComparisonExpression() - .withName("category") - .withOperator(BudgetOperatorType.IN) - .withValues(Arrays.asList("Dev", "Prod"))), - new BudgetFilterProperties() - .withTags( - new BudgetComparisonExpression() - .withName("department") - .withOperator(BudgetOperatorType.IN) - .withValues(Arrays.asList("engineering", "sales")))))) - .withNotifications( - mapOf( - "Actual_GreaterThan_80_Percent", - new Notification() - .withEnabled(true) - .withOperator(OperatorType.GREATER_THAN) - .withThreshold(new BigDecimal("80")) - .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) - .withContactRoles(Arrays.asList("Contributor", "Reader")) - .withContactGroups( - Arrays - .asList( - "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) - .withThresholdType(ThresholdType.ACTUAL) - .withLocale(CultureCode.EN_US))) + .withTimePeriod(new BudgetTimePeriod().withStartDate(OffsetDateTime.parse("2017-10-01T00:00:00Z")) + .withEndDate(OffsetDateTime.parse("2018-10-31T00:00:00Z"))) + .withFilter(new BudgetFilter().withAnd(Arrays.asList( + new BudgetFilterProperties().withDimensions(new BudgetComparisonExpression().withName("ResourceId") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/MSVM2", + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Compute/virtualMachines/platformcloudplatformGeneric1"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("category") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("Dev", "Prod"))), + new BudgetFilterProperties().withTags(new BudgetComparisonExpression().withName("department") + .withOperator(BudgetOperatorType.IN) + .withValues(Arrays.asList("engineering", "sales")))))) + .withNotifications(mapOf("Actual_GreaterThan_80_Percent", new Notification().withEnabled(true) + .withOperator(OperatorType.GREATER_THAN) + .withThreshold(new BigDecimal("80")) + .withContactEmails(Arrays.asList("johndoe@contoso.com", "janesmith@contoso.com")) + .withContactRoles(Arrays.asList("Contributor", "Reader")) + .withContactGroups(Arrays.asList( + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/microsoft.insights/actionGroups/SampleActionGroup")) + .withThresholdType(ThresholdType.ACTUAL) + .withLocale(CultureCode.EN_US))) .create(); } + // Use "Map.of" if available @SuppressWarnings("unchecked") private static Map mapOf(Object... inputs) { Map map = new HashMap<>(); 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 05711c0d6537..6b884570b5ea 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,21 +4,21 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Budgets Delete. */ +/** + * 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-11-01/examples/DeleteBudget.json */ /** * Sample code: DeleteBudget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void deleteBudget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() - .deleteWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + manager.budgets() + .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 077d0e6279bd..3d165776285c 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,21 +4,21 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Budgets Get. */ +/** + * 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-11-01/examples/Budget.json */ /** * Sample code: Budget. - * + * * @param manager Entry point to ConsumptionManager. */ public static void budget(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .budgets() - .getWithResponse("subscriptions/00000000-0000-0000-0000-000000000000", "TestBudget", Context.NONE); + manager.budgets() + .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 eaf7f20cf4d9..c597808b846d 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,19 +4,19 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Budgets List. */ +/** + * 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-11-01/examples/BudgetsList.json */ /** * Sample code: BudgetsList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void budgetsList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.budgets().list("subscriptions/00000000-0000-0000-0000-000000000000", Context.NONE); + 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 d7718f3dd3b7..eef814a248c8 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,278 +4,203 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Charges List. */ +/** + * 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-11-01/examples/ChargesListByModernBillingAccount.json */ /** * Sample code: ChargesListByBillingAccount-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByBillingAccountModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-10-31", - null, - null, - Context.NONE); + public static void + chargesListByBillingAccountModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-10-31", + null, null, 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-11-01/examples/ChargesForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: ChangesForBillingPeriodByEnrollmentAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void changesForBillingPeriodByEnrollmentAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", - null, - null, - null, - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", 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/ChargesListByModernBillingAccountGroupByCustomerId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernBillingAccountGroupByCustomerId.json */ /** * Sample code: ChargesListByBillingAccountGroupByCustomerId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByCustomerIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/customerId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-09-30", + null, "groupby((properties/customerId))", 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-11-01/examples/ChargesListByModernBillingProfile.json */ /** * Sample code: ChargesListByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByBillingProfileModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListByBillingProfileModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2460", null, null, + null, null, 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-11-01/examples/ChargesListByModernBillingProfileInvoiceSection.json */ /** * Sample code: ChargesListByBillingProfileInvoiceSection-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileInvoiceSectionModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() + manager.charges() .listWithResponse( "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425/invoiceSections/67890", - "2019-09-01", - "2019-10-31", - null, - null, - Context.NONE); + "2019-09-01", "2019-10-31", null, null, 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-11-01/examples/ChargesListByModernCustomer.json */ /** * Sample code: ChargesListByCustomer-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByCustomerModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", - null, - null, - null, - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/67890", 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/ChargesListForDepartmentFilterByStartEndDate.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListForDepartmentFilterByStartEndDate.json */ /** * Sample code: ChargesListByDepartment-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", - null, - null, - "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", - null, - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", null, null, + "usageStart eq '2018-04-01' AND usageEnd eq '2018-05-30'", null, 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-11-01/examples/ChargesListForEnrollmentAccountFilterByStartEndDate.json */ /** * Sample code: ChargesListForEnrollmentAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListForEnrollmentAccountLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListForEnrollmentAccountLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/enrollmentAccounts/42425", 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/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernBillingProfileGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingProfileGroupByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingProfileGroupByInvoiceSectionIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/invoiceSectionId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", "2019-09-30", null, "groupby((properties/invoiceSectionId))", + 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-11-01/examples/ChargesListByModernBillingAccountGroupByBillingProfileId.json */ /** * Sample code: ChargesListByBillingAccountGroupByBillingProfileId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByBillingProfileIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/billingProfileId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789", "2019-09-01", "2019-09-30", + null, "groupby((properties/billingProfileId))", 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-11-01/examples/ChargesListByModernBillingAccountGroupByInvoiceSectionId.json */ /** * Sample code: ChargesListByBillingAccountGroupByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void chargesListByBillingAccountGroupByInvoiceSectionIdModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", - "2019-09-01", - "2019-09-30", - null, - "groupby((properties/invoiceSectionId))", - Context.NONE); + manager.charges() + .listWithResponse("providers/Microsoft.Billing/billingAccounts/1234:56789/billingProfiles/42425", + "2019-09-01", "2019-09-30", null, "groupby((properties/invoiceSectionId))", + 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-11-01/examples/ChargesForBillingPeriodByDepartment.json */ /** * Sample code: ChangesForBillingPeriodByDepartment-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void changesForBillingPeriodByDepartmentLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", - null, - null, - null, - null, - Context.NONE); + public static void + changesForBillingPeriodByDepartmentLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234/departments/42425", 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/ChargesListByModernInvoiceSectionId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ChargesListByModernInvoiceSectionId.json */ /** * Sample code: ChargesListByInvoiceSectionId-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void chargesListByInvoiceSectionIdModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .charges() - .listWithResponse( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", - null, - null, - null, - null, - Context.NONE); + public static void + chargesListByInvoiceSectionIdModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.charges() + .listWithResponse("providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/97531", null, + null, null, null, 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 da4b6e060728..cfcf488e0eee 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,19 +4,19 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Credits Get. */ +/** + * 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-11-01/examples/CreditSummaryByBillingProfile.json */ /** * Sample code: CreditSummaryByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void creditSummaryByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.credits().getWithResponse("1234:5678", "2468", Context.NONE); + 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 9aa86101d18e..6bfa778b59ef 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,35 +4,93 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for EventsOperation ListByBillingAccount. */ +/** + * 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-11-01/examples/EventsGetByBillingAccount-Primary.json + */ + /** + * Sample code: EventsGetByBillingAccount-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccountWithFilters-Primary.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountWithFiltersPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccount.json */ /** * Sample code: EventsGetByBillingAccount. - * + * * @param manager Entry point to ConsumptionManager. */ public static void eventsGetByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + 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-11-01/examples/EventsGetByBillingAccountWithFilters.json */ /** * Sample code: EventsGetByBillingAccountWithFilters. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void eventsGetByBillingAccountWithFilters( + public static void + eventsGetByBillingAccountWithFilters(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccountWithFilters-Contributor.json + */ + /** + * Sample code: EventsGetByBillingAccountWithFilters-Contributor.json. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void eventsGetByBillingAccountWithFiltersContributorJson( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .eventsOperations() - .listByBillingAccount( - "1234:5678", "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", Context.NONE); + manager.eventsOperations() + .listByBillingAccount("1234:5678", + "lotid eq 'G202001083926600XXXXX' AND lotsource eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/EventsGetByBillingAccount-Contributor.json + */ + /** + * Sample code: EventsGetByBillingAccount-Contributor. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + eventsGetByBillingAccountContributor(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.eventsOperations().listByBillingAccount("1234:5678", null, 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 00f8425f2f70..90902541a041 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,19 +4,20 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for EventsOperation ListByBillingProfile. */ +/** + * 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-11-01/examples/EventsListByBillingProfile.json */ /** * Sample code: EventsListByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void eventsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.eventsOperations().listByBillingProfile("1234:5678", "4268", "2019-09-01", "2019-10-31", Context.NONE); + 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 690b8b71a558..8508a6e8749d 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,35 +4,90 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for LotsOperation ListByBillingAccount. */ +/** + * 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-11-01/examples/LotsListByBillingAccount.json */ /** * Sample code: LotsListByBillingAccount. - * + * * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingAccount(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingAccount("1234:5678", null, Context.NONE); + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccount-Primary.json + */ + /** + * Sample code: LotsListByBillingAccount-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountPrimary(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + 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-11-01/examples/LotsListByBillingAccountWithFilters.json */ /** * Sample code: LotsListByBillingAccountWithStatusFilter. - * + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountWithStatusFilter(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations() + .listByBillingAccount("1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccount-Contributor.json + */ + /** + * Sample code: LotsListByBillingAccount-Contributor. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void + lotsListByBillingAccountContributor(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations().listByBillingAccount("1234:5678", null, com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccountWithFilters-Primary.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter-Primary. + * + * @param manager Entry point to ConsumptionManager. + */ + public static void lotsListByBillingAccountWithStatusFilterPrimary( + com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.lotsOperations() + .listByBillingAccount("1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", + com.azure.core.util.Context.NONE); + } + + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/LotsListByBillingAccountWithFilters-Contributor.json + */ + /** + * Sample code: LotsListByBillingAccountWithStatusFilter-Contributor. + * * @param manager Entry point to ConsumptionManager. */ - public static void lotsListByBillingAccountWithStatusFilter( + public static void lotsListByBillingAccountWithStatusFilterContributor( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .lotsOperations() - .listByBillingAccount( - "1234:5678", "status eq 'active' AND source eq 'consumptioncommitment'", Context.NONE); + manager.lotsOperations() + .listByBillingAccount("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 d7b969519c18..fb23e1e1dec4 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,19 +4,19 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for LotsOperation ListByBillingProfile. */ +/** + * 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-11-01/examples/LotsListByBillingProfile.json */ /** * Sample code: LotsListByBillingProfile. - * + * * @param manager Entry point to ConsumptionManager. */ public static void lotsListByBillingProfile(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.lotsOperations().listByBillingProfile("1234:5678", "2468", Context.NONE); + 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 000000000000..e9c736d941c3 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/LotsOperationListByCustomerSamples.java @@ -0,0 +1,36 @@ +// 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-11-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-11-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 a0a5c0d2dcde..86f503ee0571 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,151 +4,153 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Marketplaces List. */ +/** + * 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-11-01/examples/MarketplacesByBillingAccountListForBillingPeriod.json */ /** * Sample code: BillingAccountMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void billingAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByEnrollmentAccounts_ListByBillingPeriod.json */ /** * Sample code: EnrollmentAccountMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesList.json */ /** * Sample code: SubscriptionMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void subscriptionMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByEnrollmentAccountList.json */ /** * Sample code: EnrollmentAccountMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void enrollmentAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/enrollmentAccounts/123456", null, null, null, Context.NONE); + public static void + enrollmentAccountMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesByDepartment_ListByBillingPeriod.json */ /** * Sample code: DepartmentMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void departmentMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + public static void + departmentMarketplacesListForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + 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-11-01/examples/MarketplacesByManagementGroupList.json */ /** * Sample code: ManagementGroupMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void managementGroupMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + public static void + managementGroupMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesListForBillingPeriod.json */ /** * Sample code: SubscriptionMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void subscriptionMarketplacesListForBillingPeriod( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + public static void + subscriptionMarketplacesListForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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-11-01/examples/MarketplacesByDepartmentList.json */ /** * Sample code: DepartmentMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ public static void departmentMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.marketplaces().list("providers/Microsoft.Billing/departments/123456", null, null, null, Context.NONE); + 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-11-01/examples/MarketplacesByManagementGroup_ListForBillingPeriod.json */ /** * Sample code: ManagementGroupMarketplacesListForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void managementGroupMarketplacesListForBillingPeriod( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, Context.NONE); + manager.marketplaces() + .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-11-01/examples/MarketplacesByBillingAccountList.json */ /** * Sample code: BillingAccountMarketplacesList. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountMarketplacesList( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .marketplaces() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, null, null, Context.NONE); + public static void + billingAccountMarketplacesList(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.marketplaces() + .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 000000000000..a80bccfb8a85 --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +/** + * Samples for Operations List. + */ +public final class OperationsListSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-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 000000000000..25e4ff4fe33f --- /dev/null +++ b/sdk/consumption/azure-resourcemanager-consumption/src/samples/java/com/azure/resourcemanager/consumption/generated/PriceSheetDownloadByBillingAccountPeriodSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.consumption.generated; + +/** + * Samples for PriceSheet DownloadByBillingAccountPeriod. + */ +public final class PriceSheetDownloadByBillingAccountPeriodSamples { + /* + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-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 2fd13c9b6894..4a16a2b59cf4 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,31 +4,33 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for PriceSheet GetByBillingPeriod. */ +/** + * 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-11-01/examples/PriceSheetForBillingPeriod.json */ /** * Sample code: PriceSheetForBillingPeriod. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheetForBillingPeriod(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", null, null, null, Context.NONE); + 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-11-01/examples/PriceSheetExpand.json */ /** * Sample code: PriceSheetExpand. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheetExpand(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getByBillingPeriodWithResponse("201801", "meterDetails", null, null, Context.NONE); + 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 89d4b805d63e..686bd69c76d4 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,19 +4,19 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for PriceSheet Get. */ +/** + * 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-11-01/examples/PriceSheet.json */ /** * Sample code: PriceSheet. - * + * * @param manager Entry point to ConsumptionManager. */ public static void priceSheet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.priceSheets().getWithResponse(null, null, null, Context.NONE); + 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 6ea6dcad3a88..47331e83439c 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,70 +4,75 @@ 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. */ +/** + * 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-11-01/examples/ReservationRecommendationDetailsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("subscriptions/00000000-0000-0000-0000-00000000", Scope.SINGLE, "westus", Term.P3Y, + LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", null, 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-11-01/examples/ReservationRecommendationDetailsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingProfileModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() + 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", + "properties/subscriptionId eq 00000000-0000-0000-0000-00000000", 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-11-01/examples/ReservationRecommendationDetailsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Single", "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("subscriptions/00000000-0000-0000-0000-00000000/resourceGroups/testGroup", Scope.SINGLE, + "westus", Term.P3Y, LookBackPeriod.LAST30DAYS, "Standard_DS13_v2", null, + 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-11-01/examples/ReservationRecommendationDetailsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendationDetails() - .getWithResponse("Shared", "eastus", Term.P1Y, LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", Context.NONE); + manager.reservationRecommendationDetails() + .getWithResponse("providers/Microsoft.Billing/billingAccounts/00000000", Scope.SHARED, "eastus", Term.P1Y, + LookBackPeriod.LAST60DAYS, "Standard_DS14_v2", + "properties/subscriptionId eq 00000000-0000-0000-0000-00000000", 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 138e5e91c894..94d988587b88 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,85 +4,81 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for ReservationRecommendations List. */ +/** + * 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-11-01/examples/ReservationRecommendationsBySubscription.json */ /** * Sample code: ReservationRecommendationsBySubscription-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsBySubscriptionLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByBillingProfile.json */ /** * Sample code: ReservationRecommendationsByBillingProfile-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingProfileModern( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456/billingProfiles/6420", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByResourceGroup.json */ /** * Sample code: ReservationRecommendationsByResourceGroup-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByResourceGroupLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testGroup", null, Context.NONE); + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod.json */ /** * Sample code: ReservationRecommendationsFilterBySubscriptionForScopeLookBackPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsFilterBySubscriptionForScopeLookBackPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", + manager.reservationRecommendations() + .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-11-01/examples/ReservationRecommendationsByBillingAccount.json */ /** * Sample code: ReservationRecommendationsByBillingAccount-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationRecommendationsByBillingAccountLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationRecommendations() - .list("providers/Microsoft.Billing/billingAccounts/123456", null, Context.NONE); + manager.reservationRecommendations() + .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 2df7af00151f..fcdfda51f506 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,26 +4,24 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for ReservationTransactions ListByBillingProfile. */ +/** + * 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-11-01/examples/ReservationTransactionsListByBillingProfileId.json */ /** * Sample code: ReservationTransactionsByBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationTransactionsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationTransactions() + public static void + reservationTransactionsByBillingProfileId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationTransactions() .listByBillingProfile( "fcebaabc-fced-4284-a83d-79f83dee183c:45796ba8-988f-45ad-bea9-7b71fc6c7513_2018-09-30", - "Z76D-SGAF-BG7-TGB", - "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", - Context.NONE); + "Z76D-SGAF-BG7-TGB", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", + 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 c1225f41c2a4..92c7cf44308d 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,22 +4,24 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; +import java.math.BigDecimal; -/** Samples for ReservationTransactions List. */ +/** + * 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-11-01/examples/ReservationTransactionsListByEnrollmentNumber.json */ /** * Sample code: ReservationTransactionsByEnrollmentNumber. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationTransactionsByEnrollmentNumber( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationTransactions() - .list("123456", "properties/eventDate ge 2020-05-20 AND properties/eventDate le 2020-05-30", Context.NONE); + 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", 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 3207aa8e9016..e5c3dc5e1762 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,26 +4,24 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails ListByReservationOrderAndReservation. */ +/** + * 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-11-01/examples/ReservationDetailsWithReservationId.json */ /** * Sample code: ReservationDetailsWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", + public static void + reservationDetailsWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - Context.NONE); + 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 5a3ac3508b85..fb5bd5ae8e22 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,24 +4,22 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails ListByReservationOrder. */ +/** + * 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-11-01/examples/ReservationDetails.json */ /** * Sample code: ReservationDetails. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationDetails(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .listByReservationOrder( - "00000000-0000-0000-0000-000000000000", + manager.reservationsDetails() + .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 94c739663dee..64572233f3d5 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,73 +4,54 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for ReservationsDetails List. */ +/** + * 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-11-01/examples/ReservationDetailsByBillingProfileIdReservationId.json */ /** * Sample code: ReservationDetailsByBillingProfileIdReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationDetailsByBillingProfileIdReservationId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - "2019-09-01", - "2019-10-31", - null, - "1c6b6358-709f-484c-85f1-72e862a0cf3b", - "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", "2019-09-01", + "2019-10-31", null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + 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-11-01/examples/ReservationDetailsByBillingAccountId.json */ /** * Sample code: ReservationDetailsByBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsByBillingAccountId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - null, - null, - "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", - null, - null, - Context.NONE); + public static void + reservationDetailsByBillingAccountId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345", null, null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-12-05", null, null, + 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-11-01/examples/ReservationDetailsByBillingProfileId.json */ /** * Sample code: ReservationDetailsByBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationDetailsByBillingProfileId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsDetails() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - "2019-09-01", - "2019-10-31", - null, - null, - null, - Context.NONE); + public static void + reservationDetailsByBillingProfileId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsDetails() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", "2019-09-01", + "2019-10-31", null, null, null, 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 cf09a00f17e5..09ecd28b92a5 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,48 +4,41 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries ListByReservationOrderAndReservation. */ +/** + * 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-11-01/examples/ReservationSummariesDailyWithReservationId.json */ /** * Sample code: ReservationSummariesDailyWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesDailyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - Datagrain.DAILY, + public static void + reservationSummariesDailyWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsSummaries() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + 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-11-01/examples/ReservationSummariesMonthlyWithReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void reservationSummariesMonthlyWithReservationId( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrderAndReservation( - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - Datagrain.MONTHLY, - null, - Context.NONE); + public static void + reservationSummariesMonthlyWithReservationId(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.reservationsSummaries() + .listByReservationOrderAndReservation("00000000-0000-0000-0000-000000000000", + "00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, 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 d5b722788fbd..58446067ab4c 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,40 +4,38 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries ListByReservationOrder. */ +/** + * 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-11-01/examples/ReservationSummariesMonthly.json */ /** * Sample code: ReservationSummariesMonthly. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthly(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.MONTHLY, null, Context.NONE); + manager.reservationsSummaries() + .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-11-01/examples/ReservationSummariesDaily.json */ /** * Sample code: ReservationSummariesDaily. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDaily(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .listByReservationOrder( - "00000000-0000-0000-0000-000000000000", - Datagrain.DAILY, + manager.reservationsSummaries() + .listByReservationOrder("00000000-0000-0000-0000-000000000000", Datagrain.DAILY, "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - Context.NONE); + 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 7289882cd5a3..589e0d06be35 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,123 +4,86 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Datagrain; -/** Samples for ReservationsSummaries List. */ +/** + * 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-11-01/examples/ReservationSummariesDailyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesDailyWithBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingAccountId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - Datagrain.DAILY, - null, - null, - "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345", Datagrain.DAILY, null, null, + "properties/usageDate ge 2017-10-01 AND properties/usageDate le 2017-11-20", null, null, + 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-11-01/examples/ReservationSummariesDailyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesDailyWithBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesDailyWithBillingProfileId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.DAILY, - "2017-10-01", - "2017-11-20", - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.DAILY, + "2017-10-01", "2017-11-20", null, null, null, 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-11-01/examples/ReservationSummariesMonthlyWithBillingAccountId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingAccountId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingAccountId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345", - Datagrain.MONTHLY, - null, - null, - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345", Datagrain.MONTHLY, 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/ReservationSummariesMonthlyWithBillingProfileId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ReservationSummariesMonthlyWithBillingProfileId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.MONTHLY, - null, - null, - null, - null, - null, - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, + 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/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/ReservationSummariesMonthlyWithBillingProfileIdReservationId.json */ /** * Sample code: ReservationSummariesMonthlyWithBillingProfileIdReservationId. - * + * * @param manager Entry point to ConsumptionManager. */ public static void reservationSummariesMonthlyWithBillingProfileIdReservationId( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .reservationsSummaries() - .list( - "providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", - Datagrain.MONTHLY, - null, - null, - null, - "1c6b6358-709f-484c-85f1-72e862a0cf3b", - "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", - Context.NONE); + manager.reservationsSummaries() + .list("providers/Microsoft.Billing/billingAccounts/12345:2468/billingProfiles/13579", Datagrain.MONTHLY, + null, null, null, "1c6b6358-709f-484c-85f1-72e862a0cf3b", "9f39ba10-794f-4dcb-8f4b-8d0cb47c27dc", + 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 be0a881edbe4..c2ae2ff480d1 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,19 +4,21 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; - -/** Samples for Tags Get. */ +/** + * 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-11-01/examples/Tags.json */ /** * Sample code: Tags_Get. - * + * * @param manager Entry point to ConsumptionManager. */ public static void tagsGet(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager.tags().getWithResponse("providers/Microsoft.CostManagement/billingAccounts/1234", Context.NONE); + 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 3286358ace12..404fac5877b0 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,347 +4,293 @@ package com.azure.resourcemanager.consumption.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.consumption.models.Metrictype; -/** Samples for UsageDetails List. */ +/** + * 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-11-01/examples/UsageDetailsListForBillingPeriodByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void billingAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCAInvoiceSection.json */ /** * Sample code: InvoiceSectionUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void invoiceSectionUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", - null, - null, - null, - null, - null, - Context.NONE); + public static void + invoiceSectionUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234:56789/invoiceSections/98765", null, null, null, + null, null, 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-11-01/examples/UsageDetailsList.json */ /** * Sample code: UsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListFilterByTag.json */ /** * Sample code: UsageDetailsListFilterByTag-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListFilterByTagLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - "tags eq 'dev:tools'", - null, - null, - null, - Context.NONE); + public static void + usageDetailsListFilterByTagLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, "tags eq 'dev:tools'", null, null, null, + 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-11-01/examples/UsageDetailsListByBillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234", null, null, null, null, null, Context.NONE); + public static void + billingAccountUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCABillingProfile.json */ /** * Sample code: BillingProfileUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingProfileUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", - null, - null, - null, - null, - null, - Context.NONE); + public static void + billingProfileUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("providers/Microsoft.Billing/BillingAccounts/1234:56789/billingProfiles/2468", null, null, null, null, + null, 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-11-01/examples/UsageDetailsListForBillingPeriodByDepartment.json */ /** * Sample code: DepartmentUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void departmentUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListForBillingPeriodByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void managementGroupUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMetricAmortizedCost.json */ /** * Sample code: UsageDetailsListByMetricAmortizedCost-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricAmortizedCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.AMORTIZEDCOST, - Context.NONE); + public static void + usageDetailsListByMetricAmortizedCostLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, + Metrictype.AMORTIZEDCOST, 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-11-01/examples/UsageDetailsListByMetricUsage.json */ /** * Sample code: UsageDetailsListByMetricUsage-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricUsageLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.USAGE, - Context.NONE); + public static void + usageDetailsListByMetricUsageLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, Metrictype.USAGE, + 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-11-01/examples/UsageDetailsListByManagementGroup.json */ /** * Sample code: ManagementGroupUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void managementGroupUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + public static void + managementGroupUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByDepartment.json */ /** * Sample code: DepartmentUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void departmentUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/Departments/1234", null, null, null, null, null, Context.NONE); + public static void + departmentUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMetricActualCost.json */ /** * Sample code: UsageDetailsListByMetricActualCost-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListByMetricActualCostLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - Metrictype.ACTUALCOST, - Context.NONE); + public static void + usageDetailsListByMetricActualCostLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, Metrictype.ACTUALCOST, + 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-11-01/examples/UsageDetailsListByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsList-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void enrollmentAccountUsageDetailsListLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + public static void + enrollmentAccountUsageDetailsListLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCABillingAccount.json */ /** * Sample code: BillingAccountUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void billingAccountUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/BillingAccounts/1234:56789", null, null, null, null, null, Context.NONE); + public static void + billingAccountUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .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-11-01/examples/UsageDetailsListByMCACustomer.json */ /** * Sample code: CustomerUsageDetailsList-Modern. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void customerUsageDetailsListModern( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() + public static void + customerUsageDetailsListModern(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() .list( "providers/Microsoft.Billing/BillingAccounts/1234:56789/customers/00000000-0000-0000-0000-000000000000", - null, - null, - null, - null, - null, - Context.NONE); + 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/UsageDetailsExpand.json + * x-ms-original-file: specification/consumption/resource-manager/Microsoft.Consumption/stable/2023-11-01/examples/UsageDetailsExpand.json */ /** * Sample code: UsageDetailsExpand-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void usageDetailsExpandLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list( - "subscriptions/00000000-0000-0000-0000-000000000000", - "meterDetails,additionalInfo", - "tags eq 'dev:tools'", - null, - 1, - null, - Context.NONE); + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", "meterDetails,additionalInfo", + "tags eq 'dev:tools'", null, 1, null, 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-11-01/examples/UsageDetailsListForBillingPeriodByEnrollmentAccount.json */ /** * Sample code: EnrollmentAccountUsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ public static void enrollmentAccountUsageDetailsListForBillingPeriodLegacy( com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("providers/Microsoft.Billing/EnrollmentAccounts/1234", null, null, null, null, null, Context.NONE); + manager.usageDetails() + .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-11-01/examples/UsageDetailsListForBillingPeriod.json */ /** * Sample code: UsageDetailsListForBillingPeriod-Legacy. - * + * * @param manager Entry point to ConsumptionManager. */ - public static void usageDetailsListForBillingPeriodLegacy( - com.azure.resourcemanager.consumption.ConsumptionManager manager) { - manager - .usageDetails() - .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, Context.NONE); + public static void + usageDetailsListForBillingPeriodLegacy(com.azure.resourcemanager.consumption.ConsumptionManager manager) { + manager.usageDetails() + .list("subscriptions/00000000-0000-0000-0000-000000000000", null, null, null, null, null, + com.azure.core.util.Context.NONE); } }