From 0245c09004cf1af6046af3c8b832f30bdc30bafc Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 24 Mar 2023 02:31:14 +0000 Subject: [PATCH] CodeGen from PR 23274 in Azure/azure-rest-api-specs Merge 89d05c64a3f292dcafc7d8130b82a49f20c4c7cf into 9b021813e67211ccfc3fa98e3381af1b18aadcc6 --- .../azure-resourcemanager-quota/CHANGELOG.md | 4 +- .../azure-resourcemanager-quota/README.md | 27 +++-- .../azure-resourcemanager-quota/SAMPLE.md | 91 +++++++--------- sdk/quota/azure-resourcemanager-quota/pom.xml | 10 +- .../resourcemanager/quota/QuotaManager.java | 70 ++++++++++-- .../quota/fluent/QuotaOperationsClient.java | 12 +- .../fluent/QuotaRequestStatusClient.java | 12 +- .../quota/fluent/QuotasClient.java | 20 ++-- .../quota/fluent/UsagesClient.java | 12 +- .../models/CurrentQuotaLimitBaseInner.java | 11 +- .../fluent/models/CurrentUsagesBaseInner.java | 8 +- .../fluent/models/OperationResponseInner.java | 8 +- .../models/QuotaRequestDetailsInner.java | 8 +- .../fluent/models/QuotaRequestProperties.java | 12 +- .../AzureQuotaExtensionApiBuilder.java | 58 +++++----- .../AzureQuotaExtensionApiImpl.java | 15 +-- .../QuotaOperationsClientImpl.java | 51 +++++---- .../implementation/QuotaOperationsImpl.java | 3 +- .../QuotaRequestStatusClientImpl.java | 57 ++++------ .../QuotaRequestStatusImpl.java | 21 ++-- .../implementation/QuotasClientImpl.java | 103 +++++++++--------- .../quota/implementation/QuotasImpl.java | 29 +++-- .../implementation/UsagesClientImpl.java | 59 +++++----- .../quota/implementation/UsagesImpl.java | 21 ++-- .../quota/models/LimitJsonObject.java | 6 +- .../quota/models/LimitObject.java | 8 +- .../quota/models/LimitType.java | 17 ++- .../quota/models/OperationDisplay.java | 8 +- .../quota/models/OperationList.java | 8 +- .../quota/models/QuotaLimitTypes.java | 17 ++- .../quota/models/QuotaLimits.java | 11 +- .../quota/models/QuotaOperations.java | 12 +- .../quota/models/QuotaProperties.java | 28 ++--- .../quota/models/QuotaRequestDetailsList.java | 11 +- .../quota/models/QuotaRequestState.java | 17 ++- .../quota/models/QuotaRequestStatus.java | 12 +- .../resourcemanager/quota/models/Quotas.java | 12 +- .../quota/models/QuotasGetHeaders.java | 16 ++- .../quota/models/QuotasGetResponse.java | 6 +- .../quota/models/QuotasListHeaders.java | 16 ++- .../quota/models/QuotasListNextHeaders.java | 16 ++- .../quota/models/QuotasListNextResponse.java | 6 +- .../quota/models/QuotasListResponse.java | 6 +- .../quota/models/ResourceName.java | 8 +- .../quota/models/ServiceErrorDetail.java | 8 +- .../quota/models/SubRequest.java | 13 +-- .../resourcemanager/quota/models/Usages.java | 12 +- .../quota/models/UsagesGetHeaders.java | 16 ++- .../quota/models/UsagesGetResponse.java | 6 +- .../quota/models/UsagesLimits.java | 11 +- .../quota/models/UsagesListHeaders.java | 16 ++- .../quota/models/UsagesListNextHeaders.java | 16 ++- .../quota/models/UsagesListNextResponse.java | 6 +- .../quota/models/UsagesListResponse.java | 6 +- .../quota/models/UsagesObject.java | 8 +- .../quota/models/UsagesProperties.java | 25 ++--- .../quota/models/UsagesTypes.java | 17 ++- .../generated/QuotaCreateOrUpdateSamples.java | 8 +- .../quota/generated/QuotaGetSamples.java | 10 +- .../quota/generated/QuotaListSamples.java | 14 +-- .../generated/QuotaOperationListSamples.java | 6 +- .../QuotaRequestStatusGetSamples.java | 14 +-- .../QuotaRequestStatusListSamples.java | 6 +- .../quota/generated/QuotaUpdateSamples.java | 9 +- .../quota/generated/UsagesGetSamples.java | 10 +- .../quota/generated/UsagesListSamples.java | 14 +-- 66 files changed, 679 insertions(+), 535 deletions(-) diff --git a/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md b/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md index 93dfc1d9c0d4..264f2ec65c15 100644 --- a/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md +++ b/sdk/quota/azure-resourcemanager-quota/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2023-03-24) + +- Azure Resource Manager quota client library for Java. This package contains Microsoft Azure SDK for quota Management SDK. Microsoft Azure Quota Resource Provider. Package tag package-2023-02-01. 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/quota/azure-resourcemanager-quota/README.md b/sdk/quota/azure-resourcemanager-quota/README.md index 551fa366fec2..91326e71c752 100644 --- a/sdk/quota/azure-resourcemanager-quota/README.md +++ b/sdk/quota/azure-resourcemanager-quota/README.md @@ -2,7 +2,7 @@ Azure Resource Manager quota client library for Java. -This package contains Microsoft Azure SDK for quota Management SDK. Microsoft Azure Quota Resource Provider. Package tag package-2021-03-15-preview. 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 quota Management SDK. Microsoft Azure Quota Resource Provider. Package tag package-2023-02-01. 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-quota - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -41,19 +41,19 @@ Various documentation is available to help you get started Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. -[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. +[Azure Identity][azure_identity] and [Azure Core Netty HTTP][azure_core_http_netty] packages provide the default implementation. ### Authentication -By default, Azure Active Directory token authentication depends on correct configure of following environment variables. +By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. - `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. -In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. +In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -With above configuration, `azure` client can be authenticated by following code: +With above configuration, `azure` client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -83,13 +83,13 @@ See [API design][design] for general introduction on design and key concepts on ## Contributing -For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). +For details on contributing to this repository, see the [contributing guide][cg]. -1. Fork it -1. Create your feature branch (`git checkout -b my-new-feature`) -1. Commit your changes (`git commit -am 'Add some feature'`) -1. Push to the branch (`git push origin my-new-feature`) -1. Create new Pull Request +This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] or contact with any additional questions or comments. [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS @@ -100,3 +100,6 @@ For details on contributing to this repository, see the [contributing guide](htt [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty [authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md [design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md +[cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ diff --git a/sdk/quota/azure-resourcemanager-quota/SAMPLE.md b/sdk/quota/azure-resourcemanager-quota/SAMPLE.md index f371ebb5029a..257c2498bb06 100644 --- a/sdk/quota/azure-resourcemanager-quota/SAMPLE.md +++ b/sdk/quota/azure-resourcemanager-quota/SAMPLE.md @@ -31,7 +31,7 @@ import com.azure.resourcemanager.quota.models.ResourceName; /** Samples for Quota CreateOrUpdate. */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putMachineLearningServicesQuotaRequestLowPriority.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putMachineLearningServicesQuotaRequestLowPriority.json */ /** * Sample code: Quotas_Request_ForMachineLearningServices_LowPriorityResource. @@ -54,7 +54,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json */ /** * Sample code: Quotas_PutRequest_ForNetwork_StandardSkuPublicIpAddressesResource. @@ -77,7 +77,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putComputeOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Put_Request_ForCompute. @@ -98,7 +98,7 @@ public final class QuotaCreateOrUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_PutRequest_ForNetwork. @@ -124,12 +124,10 @@ public final class QuotaCreateOrUpdateSamples { ### Quota_Get ```java -import com.azure.core.util.Context; - /** Samples for Quota Get. */ public final class QuotaGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuQuotaLimit.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -142,11 +140,11 @@ public final class QuotaGetSamples { .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuQuotaLimit.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json */ /** * Sample code: Quotas_Get_Request_ForCompute. @@ -159,7 +157,7 @@ public final class QuotaGetSamples { .getWithResponse( "standardNDSFamily", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -167,12 +165,10 @@ public final class QuotaGetSamples { ### Quota_List ```java -import com.azure.core.util.Context; - /** Samples for Quota List. */ public final class QuotaListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsMachineLearningServices. @@ -185,11 +181,11 @@ public final class QuotaListSamples { .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForCompute. @@ -201,11 +197,11 @@ public final class QuotaListSamples { .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForNetwork. @@ -217,7 +213,7 @@ public final class QuotaListSamples { .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -225,7 +221,6 @@ public final class QuotaListSamples { ### Quota_Update ```java -import com.azure.core.util.Context; import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; import com.azure.resourcemanager.quota.models.LimitObject; import com.azure.resourcemanager.quota.models.QuotaProperties; @@ -234,7 +229,7 @@ import com.azure.resourcemanager.quota.models.ResourceName; /** Samples for Quota Update. */ public final class QuotaUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchComputeQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -248,7 +243,7 @@ public final class QuotaUpdateSamples { .getWithResponse( "standardFSv2Family", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus", - Context.NONE) + com.azure.core.util.Context.NONE) .getValue(); resource .update() @@ -260,7 +255,7 @@ public final class QuotaUpdateSamples { } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchNetworkOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForNetwork. @@ -274,7 +269,7 @@ public final class QuotaUpdateSamples { .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus", - Context.NONE) + com.azure.core.util.Context.NONE) .getValue(); resource .update() @@ -291,12 +286,10 @@ public final class QuotaUpdateSamples { ### QuotaOperation_List ```java -import com.azure.core.util.Context; - /** Samples for QuotaOperation List. */ public final class QuotaOperationListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/GetOperations.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/GetOperations.json */ /** * Sample code: GetOperations. @@ -304,7 +297,7 @@ public final class QuotaOperationListSamples { * @param manager Entry point to QuotaManager. */ public static void getOperations(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.quotaOperations().list(Context.NONE); + manager.quotaOperations().list(com.azure.core.util.Context.NONE); } } ``` @@ -312,12 +305,10 @@ public final class QuotaOperationListSamples { ### QuotaRequestStatus_Get ```java -import com.azure.core.util.Context; - /** Samples for QuotaRequestStatus Get. */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusFailed.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -330,11 +321,11 @@ public final class QuotaRequestStatusGetSamples { .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusById.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -347,11 +338,11 @@ public final class QuotaRequestStatusGetSamples { .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusInProgress.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusInProgress.json */ /** * Sample code: QuotaRequestInProgress. @@ -364,7 +355,7 @@ public final class QuotaRequestStatusGetSamples { .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -372,12 +363,10 @@ public final class QuotaRequestStatusGetSamples { ### QuotaRequestStatus_List ```java -import com.azure.core.util.Context; - /** Samples for QuotaRequestStatus List. */ public final class QuotaRequestStatusListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestsHistory.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. @@ -392,7 +381,7 @@ public final class QuotaRequestStatusListSamples { null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -400,12 +389,10 @@ public final class QuotaRequestStatusListSamples { ### Usages_Get ```java -import com.azure.core.util.Context; - /** Samples for Usages Get. */ public final class UsagesGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -418,11 +405,11 @@ public final class UsagesGetSamples { .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForCompute. @@ -435,7 +422,7 @@ public final class UsagesGetSamples { .getWithResponse( "standardNDSFamily", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` @@ -443,12 +430,10 @@ public final class UsagesGetSamples { ### Usages_List ```java -import com.azure.core.util.Context; - /** Samples for Usages List. */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -460,11 +445,11 @@ public final class UsagesListSamples { .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkUsages.json */ /** * Sample code: Quotas_listUsagesForNetwork. @@ -476,11 +461,11 @@ public final class UsagesListSamples { .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesUsages.json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. @@ -492,7 +477,7 @@ public final class UsagesListSamples { .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/quota/azure-resourcemanager-quota/pom.xml b/sdk/quota/azure-resourcemanager-quota/pom.xml index 29e539c9f388..e17d3ee38264 100644 --- a/sdk/quota/azure-resourcemanager-quota/pom.xml +++ b/sdk/quota/azure-resourcemanager-quota/pom.xml @@ -1,3 +1,8 @@ + 4.0.0 @@ -13,7 +18,7 @@ jar Microsoft Azure SDK for quota Management - This package contains Microsoft Azure SDK for quota Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Quota Resource Provider. Package tag package-2021-03-15-preview. + This package contains Microsoft Azure SDK for quota Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft Azure Quota Resource Provider. Package tag package-2023-02-01. https://github.com/Azure/azure-sdk-for-java @@ -38,7 +43,8 @@ UTF-8 - true + 0 + 0 diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java index 55375329881c..3850a07fb8bc 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/QuotaManager.java @@ -10,11 +10,13 @@ import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; import com.azure.core.http.policy.RetryPolicy; import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; @@ -74,6 +76,19 @@ public static QuotaManager authenticate(TokenCredential credential, AzureProfile return configure().authenticate(credential, profile); } + /** + * Creates an instance of quota service API entry point. + * + * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. + * @param profile the Azure profile for client. + * @return the quota service API instance. + */ + public static QuotaManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return new QuotaManager(httpPipeline, profile, null); + } + /** * Gets a Configurable instance that can be used to create QuotaManager with optional configuration. * @@ -85,13 +100,14 @@ public static Configurable configure() { /** The Configurable allowing configurations to be set. */ public static final class Configurable { - private final ClientLogger logger = new ClientLogger(Configurable.class); + private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); private HttpClient httpClient; private HttpLogOptions httpLogOptions; private final List policies = new ArrayList<>(); private final List scopes = new ArrayList<>(); private RetryPolicy retryPolicy; + private RetryOptions retryOptions; private Duration defaultPollInterval; private Configurable() { @@ -152,6 +168,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. * @@ -159,9 +188,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; } @@ -183,7 +214,7 @@ public QuotaManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.quota") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -201,10 +232,15 @@ public QuotaManager authenticate(TokenCredential credential, AzureProfile profil 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( @@ -235,7 +271,11 @@ public QuotaManager authenticate(TokenCredential credential, AzureProfile profil } } - /** @return Resource collection API of Usages. */ + /** + * Gets the resource collection API of Usages. + * + * @return Resource collection API of Usages. + */ public Usages usages() { if (this.usages == null) { this.usages = new UsagesImpl(clientObject.getUsages(), this); @@ -243,7 +283,11 @@ public Usages usages() { return usages; } - /** @return Resource collection API of Quotas. */ + /** + * Gets the resource collection API of Quotas. It manages CurrentQuotaLimitBase. + * + * @return Resource collection API of Quotas. + */ public Quotas quotas() { if (this.quotas == null) { this.quotas = new QuotasImpl(clientObject.getQuotas(), this); @@ -251,7 +295,11 @@ public Quotas quotas() { return quotas; } - /** @return Resource collection API of QuotaRequestStatus. */ + /** + * Gets the resource collection API of QuotaRequestStatus. + * + * @return Resource collection API of QuotaRequestStatus. + */ public QuotaRequestStatus quotaRequestStatus() { if (this.quotaRequestStatus == null) { this.quotaRequestStatus = new QuotaRequestStatusImpl(clientObject.getQuotaRequestStatus(), this); @@ -259,7 +307,11 @@ public QuotaRequestStatus quotaRequestStatus() { return quotaRequestStatus; } - /** @return Resource collection API of QuotaOperations. */ + /** + * Gets the resource collection API of QuotaOperations. + * + * @return Resource collection API of QuotaOperations. + */ public QuotaOperations quotaOperations() { if (this.quotaOperations == null) { this.quotaOperations = new QuotaOperationsImpl(clientObject.getQuotaOperations(), this); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java index 7f8084915ea5..8d3be7c697f5 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaOperationsClient.java @@ -13,23 +13,27 @@ /** An instance of this class provides access to all the operations defined in QuotaOperationsClient. */ public interface QuotaOperationsClient { /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @throws com.azure.core.management.exception.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 paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @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 paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java index 1c1eb6e5d869..8f87e72182da 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotaRequestStatusClient.java @@ -22,14 +22,15 @@ public interface QuotaRequestStatusClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotaRequestDetailsInner get(String id, String scope); + Response getWithResponse(String id, String scope, Context context); /** * Get the quota request details and status by quota request ID for the resources of the resource provider at a @@ -40,7 +41,6 @@ public interface QuotaRequestStatusClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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. @@ -48,7 +48,7 @@ public interface QuotaRequestStatusClient { * specific location. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String id, String scope, Context context); + QuotaRequestDetailsInner get(String id, String scope); /** * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the @@ -61,7 +61,7 @@ public interface QuotaRequestStatusClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -85,7 +85,7 @@ public interface QuotaRequestStatusClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list( diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java index 81a5b5ab9865..7d87b0e6a740 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/QuotasClient.java @@ -25,13 +25,14 @@ public interface QuotasClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota limit of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CurrentQuotaLimitBaseInner get(String resourceName, String scope); + QuotasGetResponse getWithResponse(String resourceName, String scope, Context context); /** * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new @@ -43,14 +44,13 @@ public interface QuotasClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 quota limit of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotasGetResponse getWithResponse(String resourceName, String scope, Context context); + CurrentQuotaLimitBaseInner get(String resourceName, String scope); /** * Create or update the quota limit for the specified resource with the requested value. To update the quota, follow @@ -70,7 +70,7 @@ public interface QuotasClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( @@ -95,7 +95,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( @@ -168,7 +168,7 @@ CurrentQuotaLimitBaseInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( @@ -193,7 +193,7 @@ SyncPoller, CurrentQuotaLimitBaseInner> b * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( @@ -258,7 +258,8 @@ CurrentQuotaLimitBaseInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -275,7 +276,8 @@ CurrentQuotaLimitBaseInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java index d310edd06f01..261500e26e18 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/UsagesClient.java @@ -22,13 +22,14 @@ public interface UsagesClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 current usage of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CurrentUsagesBaseInner get(String resourceName, String scope); + UsagesGetResponse getWithResponse(String resourceName, String scope, Context context); /** * Get the current usage of a resource. @@ -39,14 +40,13 @@ public interface UsagesClient { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 current usage of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - UsagesGetResponse getWithResponse(String resourceName, String scope, Context context); + CurrentUsagesBaseInner get(String resourceName, String scope); /** * Get a list of current usage for all resources for the scope specified. @@ -58,7 +58,8 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope); @@ -74,7 +75,8 @@ public interface UsagesClient { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(String scope, Context context); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java index f745135c494f..3579f753d070 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentQuotaLimitBaseInner.java @@ -6,23 +6,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.models.QuotaProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Quota limit. */ @Fluent public final class CurrentQuotaLimitBaseInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CurrentQuotaLimitBaseInner.class); - /* - * Quota properties for the specified resource, based on the API called, - * Quotas or Usages. + * Quota properties for the specified resource, based on the API called, Quotas or Usages. */ @JsonProperty(value = "properties") private QuotaProperties properties; + /** Creates an instance of CurrentQuotaLimitBaseInner class. */ + public CurrentQuotaLimitBaseInner() { + } + /** * Get the properties property: Quota properties for the specified resource, based on the API called, Quotas or * Usages. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java index 95f30df1b0b4..eba27c405dbf 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/CurrentUsagesBaseInner.java @@ -6,22 +6,22 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.models.UsagesProperties; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** Resource usage. */ @Fluent public final class CurrentUsagesBaseInner extends ProxyResource { - @JsonIgnore private final ClientLogger logger = new ClientLogger(CurrentUsagesBaseInner.class); - /* * Usage properties for the specified resource. */ @JsonProperty(value = "properties") private UsagesProperties properties; + /** Creates an instance of CurrentUsagesBaseInner class. */ + public CurrentUsagesBaseInner() { + } + /** * Get the properties property: Usage properties for the specified resource. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java index 68486082b5cd..edbc3d6f23c2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/OperationResponseInner.java @@ -5,16 +5,12 @@ package com.azure.resourcemanager.quota.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.models.OperationDisplay; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; /** The OperationResponse model. */ @Fluent public final class OperationResponseInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResponseInner.class); - /* * The name property. */ @@ -33,6 +29,10 @@ public final class OperationResponseInner { @JsonProperty(value = "origin") private String origin; + /** Creates an instance of OperationResponseInner class. */ + public OperationResponseInner() { + } + /** * Get the name property: The name property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java index b134be033c08..e1c2accf8393 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestDetailsInner.java @@ -5,11 +5,9 @@ package com.azure.resourcemanager.quota.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.models.QuotaRequestState; import com.azure.resourcemanager.quota.models.ServiceErrorDetail; import com.azure.resourcemanager.quota.models.SubRequest; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -17,8 +15,6 @@ /** List of quota requests with details. */ @Fluent public final class QuotaRequestDetailsInner { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaRequestDetailsInner.class); - /* * Quota request ID. */ @@ -43,6 +39,10 @@ public final class QuotaRequestDetailsInner { @JsonProperty(value = "properties") private QuotaRequestProperties innerProperties; + /** Creates an instance of QuotaRequestDetailsInner class. */ + public QuotaRequestDetailsInner() { + } + /** * Get the id property: Quota request ID. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java index f6bad69644ab..64f5f7cf59e8 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/fluent/models/QuotaRequestProperties.java @@ -5,11 +5,9 @@ package com.azure.resourcemanager.quota.fluent.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.models.QuotaRequestState; import com.azure.resourcemanager.quota.models.ServiceErrorDetail; import com.azure.resourcemanager.quota.models.SubRequest; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.time.OffsetDateTime; import java.util.List; @@ -17,8 +15,6 @@ /** Quota request properties. */ @Fluent public final class QuotaRequestProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaRequestProperties.class); - /* * The quota request status. */ @@ -38,8 +34,8 @@ public final class QuotaRequestProperties { private ServiceErrorDetail error; /* - * The quota request submission time. The date conforms to the following - * format specified by the ISO 8601 standard: yyyy-MM-ddTHH:mm:ssZ + * The quota request submission time. The date conforms to the following format specified by the ISO 8601 standard: + * yyyy-MM-ddTHH:mm:ssZ */ @JsonProperty(value = "requestSubmitTime", access = JsonProperty.Access.WRITE_ONLY) private OffsetDateTime requestSubmitTime; @@ -50,6 +46,10 @@ public final class QuotaRequestProperties { @JsonProperty(value = "value") private List value; + /** Creates an instance of QuotaRequestProperties class. */ + public QuotaRequestProperties() { + } + /** * Get the provisioningState property: The quota request status. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiBuilder.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiBuilder.java index 3b8210d62047..a54ca0ebb91e 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiBuilder.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiBuilder.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; @@ -51,34 +50,34 @@ public AzureQuotaExtensionApiBuilder environment(AzureEnvironment environment) { } /* - * The default poll interval for long-running operation + * The HTTP pipeline to send requests through */ - private Duration defaultPollInterval; + private HttpPipeline pipeline; /** - * Sets The default poll interval for long-running operation. + * Sets The HTTP pipeline to send requests through. * - * @param defaultPollInterval the defaultPollInterval value. + * @param pipeline the pipeline value. * @return the AzureQuotaExtensionApiBuilder. */ - public AzureQuotaExtensionApiBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; + public AzureQuotaExtensionApiBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; return this; } /* - * The HTTP pipeline to send requests through + * The default poll interval for long-running operation */ - private HttpPipeline pipeline; + private Duration defaultPollInterval; /** - * Sets The HTTP pipeline to send requests through. + * Sets The default poll interval for long-running operation. * - * @param pipeline the pipeline value. + * @param defaultPollInterval the defaultPollInterval value. * @return the AzureQuotaExtensionApiBuilder. */ - public AzureQuotaExtensionApiBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; + public AzureQuotaExtensionApiBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; return this; } @@ -104,26 +103,21 @@ public AzureQuotaExtensionApiBuilder serializerAdapter(SerializerAdapter seriali * @return an instance of AzureQuotaExtensionApiImpl. */ public AzureQuotaExtensionApiImpl buildClient() { - if (endpoint == null) { - this.endpoint = "https://management.azure.com"; - } - if (environment == null) { - this.environment = AzureEnvironment.AZURE; - } - if (defaultPollInterval == null) { - this.defaultPollInterval = Duration.ofSeconds(30); - } - if (pipeline == null) { - this.pipeline = - new HttpPipelineBuilder() - .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) - .build(); - } - if (serializerAdapter == null) { - this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); - } + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = + (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval = + (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = + (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); AzureQuotaExtensionApiImpl client = - new AzureQuotaExtensionApiImpl(pipeline, serializerAdapter, defaultPollInterval, environment, endpoint); + new AzureQuotaExtensionApiImpl( + localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, localEndpoint); return client; } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java index e5a964cf36ee..47b8c2141941 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/AzureQuotaExtensionApiImpl.java @@ -15,6 +15,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; import com.azure.core.util.Context; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; @@ -32,15 +33,12 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Map; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** Initializes a new instance of the AzureQuotaExtensionApiImpl type. */ @ServiceClient(builder = AzureQuotaExtensionApiBuilder.class) public final class AzureQuotaExtensionApiImpl implements AzureQuotaExtensionApi { - private final ClientLogger logger = new ClientLogger(AzureQuotaExtensionApiImpl.class); - /** server parameter. */ private final String endpoint; @@ -168,7 +166,7 @@ public QuotaOperationsClient getQuotaOperations() { this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; - this.apiVersion = "2021-03-15-preview"; + this.apiVersion = "2023-02-01"; this.usages = new UsagesClientImpl(this); this.quotas = new QuotasClientImpl(this); this.quotaRequestStatus = new QuotaRequestStatusClientImpl(this); @@ -191,10 +189,7 @@ public Context getContext() { * @return the merged context. */ public Context mergeContext(Context context) { - for (Map.Entry entry : this.getContext().getValues().entrySet()) { - context = context.addData(entry.getKey(), entry.getValue()); - } - return context; + return CoreUtils.mergeContexts(this.getContext(), context); } /** @@ -258,7 +253,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, managementError = null; } } catch (IOException | RuntimeException ioe) { - logger.logThrowableAsWarning(ioe); + LOGGER.logThrowableAsWarning(ioe); } } } else { @@ -317,4 +312,6 @@ public Mono getBodyAsString(Charset charset) { return Mono.just(new String(responseBody, charset)); } } + + private static final ClientLogger LOGGER = new ClientLogger(AzureQuotaExtensionApiImpl.class); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java index b7ec07abf01f..bfa7ab00a576 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.QuotaOperationsClient; import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; import com.azure.resourcemanager.quota.models.OperationList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in QuotaOperationsClient. */ public final class QuotaOperationsClientImpl implements QuotaOperationsClient { - private final ClientLogger logger = new ClientLogger(QuotaOperationsClientImpl.class); - /** The proxy service used to perform REST calls. */ private final QuotaOperationsService service; @@ -58,7 +55,7 @@ public final class QuotaOperationsClientImpl implements QuotaOperationsClient { */ @Host("{$host}") @ServiceInterface(name = "AzureQuotaExtensionA") - private interface QuotaOperationsService { + public interface QuotaOperationsService { @Headers({"Content-Type: application/json"}) @Get("/providers/Microsoft.Quota/operations") @ExpectedResponses({200}) @@ -81,11 +78,13 @@ Mono> listNext( } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @throws 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 response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { @@ -112,13 +111,15 @@ private Mono> listSinglePageAsync() { } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @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. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { @@ -144,11 +145,13 @@ private Mono> listSinglePageAsync(Context } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @throws 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 paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -156,13 +159,15 @@ private PagedFlux listAsync() { } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @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. + * @return the paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -171,11 +176,13 @@ private PagedFlux listAsync(Context context) { } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @throws 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 paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -183,13 +190,15 @@ public PagedIterable list() { } /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @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. + * @return the paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -199,11 +208,12 @@ 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 the response. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -234,12 +244,13 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. + * @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java index 729b3a2c9028..fb88cf158364 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaOperationsImpl.java @@ -11,10 +11,9 @@ import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; import com.azure.resourcemanager.quota.models.OperationResponse; import com.azure.resourcemanager.quota.models.QuotaOperations; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class QuotaOperationsImpl implements QuotaOperations { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaOperationsImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(QuotaOperationsImpl.class); private final QuotaOperationsClient innerClient; diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java index cb58b7953fab..c0b917410533 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusClientImpl.java @@ -25,7 +25,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.QuotaRequestStatusClient; import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; import com.azure.resourcemanager.quota.models.QuotaRequestDetailsList; @@ -33,8 +32,6 @@ /** An instance of this class provides access to all the operations defined in QuotaRequestStatusClient. */ public final class QuotaRequestStatusClientImpl implements QuotaRequestStatusClient { - private final ClientLogger logger = new ClientLogger(QuotaRequestStatusClientImpl.class); - /** The proxy service used to perform REST calls. */ private final QuotaRequestStatusService service; @@ -58,7 +55,7 @@ public final class QuotaRequestStatusClientImpl implements QuotaRequestStatusCli */ @Host("{$host}") @ServiceInterface(name = "AzureQuotaExtensionA") - private interface QuotaRequestStatusService { + public interface QuotaRequestStatusService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Quota/quotaRequests/{id}") @ExpectedResponses({200}) @@ -109,7 +106,7 @@ Mono> listNext( * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String id, String scope) { @@ -147,7 +144,7 @@ private Mono> getWithResponseAsync(String id, * @throws 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getWithResponseAsync(String id, String scope, Context context) { @@ -181,19 +178,11 @@ private Mono> getWithResponseAsync(String id, * @throws 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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String id, String scope) { - return getWithResponseAsync(id, scope) - .flatMap( - (Response res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(id, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -205,15 +194,16 @@ private Mono getAsync(String id, String scope) { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaRequestDetailsInner get(String id, String scope) { - return getAsync(id, scope).block(); + public Response getWithResponse(String id, String scope, Context context) { + return getWithResponseAsync(id, scope, context).block(); } /** @@ -225,7 +215,6 @@ public QuotaRequestDetailsInner get(String id, String scope) { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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. @@ -233,8 +222,8 @@ public QuotaRequestDetailsInner get(String id, String scope) { * specific location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String id, String scope, Context context) { - return getWithResponseAsync(id, scope, context).block(); + public QuotaRequestDetailsInner get(String id, String scope) { + return getWithResponse(id, scope, Context.NONE).getValue(); } /** @@ -255,7 +244,7 @@ public Response getWithResponse(String id, String scop * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -314,7 +303,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync( @@ -362,7 +351,7 @@ private Mono> listSinglePageAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, String filter, Integer top, String skiptoken) { @@ -381,7 +370,7 @@ private PagedFlux listAsync(String scope, String filte * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -411,7 +400,7 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync( @@ -432,7 +421,7 @@ private PagedFlux listAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -461,7 +450,7 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list( @@ -472,11 +461,12 @@ public PagedIterable list( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -507,12 +497,13 @@ private Mono> listNextSinglePageAsync(St /** * 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 quota request information. + * @return quota request information along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java index 6b25090f3197..8ab7c4bff354 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotaRequestStatusImpl.java @@ -13,10 +13,9 @@ import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; import com.azure.resourcemanager.quota.models.QuotaRequestDetails; import com.azure.resourcemanager.quota.models.QuotaRequestStatus; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class QuotaRequestStatusImpl implements QuotaRequestStatus { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaRequestStatusImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(QuotaRequestStatusImpl.class); private final QuotaRequestStatusClient innerClient; @@ -28,15 +27,6 @@ public QuotaRequestStatusImpl( this.serviceManager = serviceManager; } - public QuotaRequestDetails get(String id, String scope) { - QuotaRequestDetailsInner inner = this.serviceClient().get(id, scope); - if (inner != null) { - return new QuotaRequestDetailsImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String id, String scope, Context context) { Response inner = this.serviceClient().getWithResponse(id, scope, context); if (inner != null) { @@ -50,6 +40,15 @@ public Response getWithResponse(String id, String scope, Co } } + public QuotaRequestDetails get(String id, String scope) { + QuotaRequestDetailsInner inner = this.serviceClient().get(id, scope); + if (inner != null) { + return new QuotaRequestDetailsImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); return Utils.mapPage(inner, inner1 -> new QuotaRequestDetailsImpl(inner1, this.manager())); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java index 7980c9d179c2..267f460ee08d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasClientImpl.java @@ -29,7 +29,6 @@ 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.quota.fluent.QuotasClient; @@ -43,8 +42,6 @@ /** An instance of this class provides access to all the operations defined in QuotasClient. */ public final class QuotasClientImpl implements QuotasClient { - private final ClientLogger logger = new ClientLogger(QuotasClientImpl.class); - /** The proxy service used to perform REST calls. */ private final QuotasService service; @@ -67,7 +64,7 @@ public final class QuotasClientImpl implements QuotasClient { */ @Host("{$host}") @ServiceInterface(name = "AzureQuotaExtensionA") - private interface QuotasService { + public interface QuotasService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Quota/quotas/{resourceName}") @ExpectedResponses({200}) @@ -141,7 +138,7 @@ Mono listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota limit of a resource. + * @return the quota limit of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String resourceName, String scope) { @@ -186,7 +183,7 @@ private Mono getWithResponseAsync(String resourceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota limit of a resource. + * @return the quota limit of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String resourceName, String scope, Context context) { @@ -221,19 +218,11 @@ private Mono getWithResponseAsync(String resourceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the quota limit of a resource. + * @return the quota limit of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceName, String scope) { - return getWithResponseAsync(resourceName, scope) - .flatMap( - (QuotasGetResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(resourceName, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -246,14 +235,15 @@ private Mono getAsync(String resourceName, String sc * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota limit of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentQuotaLimitBaseInner get(String resourceName, String scope) { - return getAsync(resourceName, scope).block(); + public QuotasGetResponse getWithResponse(String resourceName, String scope, Context context) { + return getWithResponseAsync(resourceName, scope, context).block(); } /** @@ -266,15 +256,14 @@ public CurrentQuotaLimitBaseInner get(String resourceName, String scope) { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 quota limit of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuotasGetResponse getWithResponse(String resourceName, String scope, Context context) { - return getWithResponseAsync(resourceName, scope, context).block(); + public CurrentQuotaLimitBaseInner get(String resourceName, String scope) { + return getWithResponse(resourceName, scope, Context.NONE).getValue(); } /** @@ -295,7 +284,7 @@ public QuotasGetResponse getWithResponse(String resourceName, String scope, Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -353,7 +342,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync( @@ -407,7 +396,7 @@ private Mono>> createOrUpdateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link PollerFlux} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginCreateOrUpdateAsync( @@ -421,7 +410,7 @@ private PollerFlux, CurrentQuotaLimitBase this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -443,7 +432,7 @@ private PollerFlux, CurrentQuotaLimitBase * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link PollerFlux} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginCreateOrUpdateAsync( @@ -479,12 +468,12 @@ private PollerFlux, CurrentQuotaLimitBase * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginCreateOrUpdateAsync(resourceName, scope, createQuotaRequest).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceName, scope, createQuotaRequest).getSyncPoller(); } /** @@ -506,12 +495,12 @@ public SyncPoller, CurrentQuotaLimitBaseI * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CurrentQuotaLimitBaseInner> beginCreateOrUpdate( String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginCreateOrUpdateAsync(resourceName, scope, createQuotaRequest, context).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceName, scope, createQuotaRequest, context).getSyncPoller(); } /** @@ -532,7 +521,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -561,7 +550,7 @@ private Mono createOrUpdateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync( @@ -642,7 +631,7 @@ public CurrentQuotaLimitBaseInner createOrUpdate( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -700,7 +689,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync( @@ -754,7 +743,7 @@ private Mono>> updateWithResponseAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link PollerFlux} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginUpdateAsync( @@ -767,7 +756,7 @@ private PollerFlux, CurrentQuotaLimitBase this.client.getHttpPipeline(), CurrentQuotaLimitBaseInner.class, CurrentQuotaLimitBaseInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -789,7 +778,7 @@ private PollerFlux, CurrentQuotaLimitBase * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link PollerFlux} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, CurrentQuotaLimitBaseInner> beginUpdateAsync( @@ -825,12 +814,12 @@ private PollerFlux, CurrentQuotaLimitBase * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest) { - return beginUpdateAsync(resourceName, scope, createQuotaRequest).getSyncPoller(); + return this.beginUpdateAsync(resourceName, scope, createQuotaRequest).getSyncPoller(); } /** @@ -852,12 +841,12 @@ public SyncPoller, CurrentQuotaLimitBaseI * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return the {@link SyncPoller} for polling of quota limit. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, CurrentQuotaLimitBaseInner> beginUpdate( String resourceName, String scope, CurrentQuotaLimitBaseInner createQuotaRequest, Context context) { - return beginUpdateAsync(resourceName, scope, createQuotaRequest, context).getSyncPoller(); + return this.beginUpdateAsync(resourceName, scope, createQuotaRequest, context).getSyncPoller(); } /** @@ -878,7 +867,7 @@ public SyncPoller, CurrentQuotaLimitBaseI * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -907,7 +896,7 @@ private Mono updateAsync( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limit. + * @return quota limit on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync( @@ -981,7 +970,8 @@ public CurrentQuotaLimitBaseInner update( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope) { @@ -1022,7 +1012,8 @@ private Mono> listSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope along with {@link PagedResponse} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope, Context context) { @@ -1061,7 +1052,8 @@ private Mono> listSinglePageAsync(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -1080,7 +1072,8 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { @@ -1099,7 +1092,8 @@ private PagedFlux listAsync(String scope, Context co * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -1118,7 +1112,8 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope, Context context) { @@ -1128,11 +1123,12 @@ public PagedIterable list(String scope, Context cont /** * 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 quota limits. + * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1163,12 +1159,13 @@ private Mono> listNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @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 quota limits. + * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java index 9eeeaeebd3c7..b58c1b1bebfb 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/QuotasImpl.java @@ -14,10 +14,9 @@ import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; import com.azure.resourcemanager.quota.models.Quotas; import com.azure.resourcemanager.quota.models.QuotasGetResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class QuotasImpl implements Quotas { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotasImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(QuotasImpl.class); private final QuotasClient innerClient; @@ -28,15 +27,6 @@ public QuotasImpl(QuotasClient innerClient, com.azure.resourcemanager.quota.Quot this.serviceManager = serviceManager; } - public CurrentQuotaLimitBase get(String resourceName, String scope) { - CurrentQuotaLimitBaseInner inner = this.serviceClient().get(resourceName, scope); - if (inner != null) { - return new CurrentQuotaLimitBaseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceName, String scope, Context context) { QuotasGetResponse inner = this.serviceClient().getWithResponse(resourceName, scope, context); if (inner != null) { @@ -50,6 +40,15 @@ public Response getWithResponse(String resourceName, Stri } } + public CurrentQuotaLimitBase get(String resourceName, String scope) { + CurrentQuotaLimitBaseInner inner = this.serviceClient().get(resourceName, scope); + if (inner != null) { + return new CurrentQuotaLimitBaseImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); return Utils.mapPage(inner, inner1 -> new CurrentQuotaLimitBaseImpl(inner1, this.manager())); @@ -66,7 +65,7 @@ public CurrentQuotaLimitBase getById(String id) { .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "resourceName"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'quotas'.", id))); @@ -75,7 +74,7 @@ public CurrentQuotaLimitBase getById(String id) { Utils .getValueFromIdByParameterName(id, "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); @@ -89,7 +88,7 @@ public Response getByIdWithResponse(String id, Context co .getValueFromIdByParameterName( id, "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "resourceName"); if (resourceName == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'quotas'.", id))); @@ -98,7 +97,7 @@ public Response getByIdWithResponse(String id, Context co Utils .getValueFromIdByParameterName(id, "/{scope}/providers/Microsoft.Quota/quotas/{resourceName}", "scope"); if (scope == null) { - throw logger + throw LOGGER .logExceptionAsError( new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'scope'.", id))); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java index 08061c51e22b..fba4b3393d72 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesClientImpl.java @@ -24,7 +24,6 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.UsagesClient; import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; import com.azure.resourcemanager.quota.models.UsagesGetResponse; @@ -34,8 +33,6 @@ /** An instance of this class provides access to all the operations defined in UsagesClient. */ public final class UsagesClientImpl implements UsagesClient { - private final ClientLogger logger = new ClientLogger(UsagesClientImpl.class); - /** The proxy service used to perform REST calls. */ private final UsagesService service; @@ -58,7 +55,7 @@ public final class UsagesClientImpl implements UsagesClient { */ @Host("{$host}") @ServiceInterface(name = "AzureQuotaExtensionA") - private interface UsagesService { + public interface UsagesService { @Headers({"Content-Type: application/json"}) @Get("/{scope}/providers/Microsoft.Quota/usages/{resourceName}") @ExpectedResponses({200}) @@ -105,7 +102,7 @@ Mono listNext( * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage of a resource. + * @return the current usage of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String resourceName, String scope) { @@ -149,7 +146,7 @@ private Mono getWithResponseAsync(String resourceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage of a resource. + * @return the current usage of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getWithResponseAsync(String resourceName, String scope, Context context) { @@ -183,19 +180,11 @@ private Mono getWithResponseAsync(String resourceName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the current usage of a resource. + * @return the current usage of a resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getAsync(String resourceName, String scope) { - return getWithResponseAsync(resourceName, scope) - .flatMap( - (UsagesGetResponse res) -> { - if (res.getValue() != null) { - return Mono.just(res.getValue()); - } else { - return Mono.empty(); - } - }); + return getWithResponseAsync(resourceName, scope).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -207,14 +196,15 @@ private Mono getAsync(String resourceName, String scope) * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 current usage of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CurrentUsagesBaseInner get(String resourceName, String scope) { - return getAsync(resourceName, scope).block(); + public UsagesGetResponse getWithResponse(String resourceName, String scope, Context context) { + return getWithResponseAsync(resourceName, scope, context).block(); } /** @@ -226,15 +216,14 @@ public CurrentUsagesBaseInner get(String resourceName, String scope) { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 current usage of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public UsagesGetResponse getWithResponse(String resourceName, String scope, Context context) { - return getWithResponseAsync(resourceName, scope, context).block(); + public CurrentUsagesBaseInner get(String resourceName, String scope) { + return getWithResponse(resourceName, scope, Context.NONE).getValue(); } /** @@ -247,7 +236,8 @@ public UsagesGetResponse getWithResponse(String resourceName, String scope, Cont * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope) { @@ -287,7 +277,8 @@ private Mono> listSinglePageAsync(String s * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String scope, Context context) { @@ -325,7 +316,8 @@ private Mono> listSinglePageAsync(String s * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope) { @@ -343,7 +335,8 @@ private PagedFlux listAsync(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String scope, Context context) { @@ -361,7 +354,8 @@ private PagedFlux listAsync(String scope, Context contex * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope) { @@ -379,7 +373,8 @@ public PagedIterable list(String scope) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String scope, Context context) { @@ -389,11 +384,12 @@ public PagedIterable list(String scope, 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 quota limits. + * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -424,12 +420,13 @@ private Mono> listNextSinglePageAsync(Stri /** * Get the next page of items. * - * @param nextLink The nextLink parameter. + * @param nextLink The URL to get the next list of items + *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota limits. + * @return quota limits along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java index 9d6cc6a56f76..f10021f9e46b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/implementation/UsagesImpl.java @@ -14,10 +14,9 @@ import com.azure.resourcemanager.quota.models.CurrentUsagesBase; import com.azure.resourcemanager.quota.models.Usages; import com.azure.resourcemanager.quota.models.UsagesGetResponse; -import com.fasterxml.jackson.annotation.JsonIgnore; public final class UsagesImpl implements Usages { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(UsagesImpl.class); private final UsagesClient innerClient; @@ -28,15 +27,6 @@ public UsagesImpl(UsagesClient innerClient, com.azure.resourcemanager.quota.Quot this.serviceManager = serviceManager; } - public CurrentUsagesBase get(String resourceName, String scope) { - CurrentUsagesBaseInner inner = this.serviceClient().get(resourceName, scope); - if (inner != null) { - return new CurrentUsagesBaseImpl(inner, this.manager()); - } else { - return null; - } - } - public Response getWithResponse(String resourceName, String scope, Context context) { UsagesGetResponse inner = this.serviceClient().getWithResponse(resourceName, scope, context); if (inner != null) { @@ -50,6 +40,15 @@ public Response getWithResponse(String resourceName, String s } } + public CurrentUsagesBase get(String resourceName, String scope) { + CurrentUsagesBaseInner inner = this.serviceClient().get(resourceName, scope); + if (inner != null) { + return new CurrentUsagesBaseImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable list(String scope) { PagedIterable inner = this.serviceClient().list(scope); return Utils.mapPage(inner, inner1 -> new CurrentUsagesBaseImpl(inner1, this.manager())); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java index f24db64eed29..e44b371cb2ee 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitJsonObject.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.quota.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.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -21,7 +19,9 @@ @JsonSubTypes({@JsonSubTypes.Type(name = "LimitValue", value = LimitObject.class)}) @Immutable public class LimitJsonObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LimitJsonObject.class); + /** Creates an instance of LimitJsonObject class. */ + public LimitJsonObject() { + } /** * Validates the instance. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java index e5bc2e5f1194..a1b3e15058e0 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitObject.java @@ -5,8 +5,6 @@ package com.azure.resourcemanager.quota.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 com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; @@ -16,8 +14,6 @@ @JsonTypeName("LimitValue") @Fluent public final class LimitObject extends LimitJsonObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(LimitObject.class); - /* * The quota/limit value */ @@ -30,6 +26,10 @@ public final class LimitObject extends LimitJsonObject { @JsonProperty(value = "limitType") private QuotaLimitTypes limitType; + /** Creates an instance of LimitObject class. */ + public LimitObject() { + } + /** * Get the value property: The quota/limit value. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java index 70e2b646137b..8df020cb9134 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/LimitType.java @@ -8,11 +8,20 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for LimitType. */ +/** The limit object type. */ public final class LimitType extends ExpandableStringEnum { /** Static value LimitValue for LimitType. */ public static final LimitType LIMIT_VALUE = fromString("LimitValue"); + /** + * Creates a new instance of LimitType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public LimitType() { + } + /** * Creates or finds a LimitType from its string representation. * @@ -24,7 +33,11 @@ public static LimitType fromString(String name) { return fromString(name, LimitType.class); } - /** @return known LimitType values. */ + /** + * Gets known LimitType values. + * + * @return known LimitType values. + */ public static Collection values() { return values(LimitType.class); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java index 074bdfb75b4a..4d3eeba3c0db 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationDisplay.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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 OperationDisplay model. */ @Fluent public final class OperationDisplay { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); - /* * Provider name. */ @@ -38,6 +34,10 @@ public final class OperationDisplay { @JsonProperty(value = "description") private String description; + /** Creates an instance of OperationDisplay class. */ + public OperationDisplay() { + } + /** * Get the provider property: Provider name. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationList.java index 7a398b8a9907..8412a7794c0b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationList.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/OperationList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** The OperationList model. */ @Fluent public final class OperationList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationList.class); - /* * The value property. */ @@ -28,6 +24,10 @@ public final class OperationList { @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of OperationList class. */ + public OperationList() { + } + /** * Get the value property: The value property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java index a9d38803d6e1..1eaa6b0ed599 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimitTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for QuotaLimitTypes. */ +/** The quota or usages limit types. */ public final class QuotaLimitTypes extends ExpandableStringEnum { /** Static value Independent for QuotaLimitTypes. */ public static final QuotaLimitTypes INDEPENDENT = fromString("Independent"); @@ -16,6 +16,15 @@ public final class QuotaLimitTypes extends ExpandableStringEnum /** Static value Shared for QuotaLimitTypes. */ public static final QuotaLimitTypes SHARED = fromString("Shared"); + /** + * Creates a new instance of QuotaLimitTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public QuotaLimitTypes() { + } + /** * Creates or finds a QuotaLimitTypes from its string representation. * @@ -27,7 +36,11 @@ public static QuotaLimitTypes fromString(String name) { return fromString(name, QuotaLimitTypes.class); } - /** @return known QuotaLimitTypes values. */ + /** + * Gets known QuotaLimitTypes values. + * + * @return known QuotaLimitTypes values. + */ public static Collection values() { return values(QuotaLimitTypes.class); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimits.java index c16b48338768..2f1aa4d9d6dc 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimits.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaLimits.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.models.CurrentQuotaLimitBaseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Quota limits. */ @Fluent public final class QuotaLimits { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaLimits.class); - /* * List of quota limits. */ @@ -23,12 +19,15 @@ public final class QuotaLimits { private List value; /* - * The URI used to fetch the next page of quota limits. When there are no - * more pages, this string is null. + * The URI used to fetch the next page of quota limits. When there are no more pages, this string is null. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of QuotaLimits class. */ + public QuotaLimits() { + } + /** * Get the value property: List of quota limits. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java index d01e7b1164e0..52b38d2eee2a 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaOperations.java @@ -10,22 +10,26 @@ /** Resource collection API of QuotaOperations. */ public interface QuotaOperations { /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @throws com.azure.core.management.exception.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 paginated response with {@link PagedIterable}. */ PagedIterable list(); /** - * List all the operations supported by the Microsoft.Quota resource provider. + * GET quota operations. + * + *

List all the operations supported by the Microsoft.Quota resource provider. * * @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 paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java index 6c3ea2dae22b..201518aba34c 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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; /** Quota properties for the specified resource. */ @Fluent public final class QuotaProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaProperties.class); - /* * Resource quota limit properties. */ @@ -21,34 +17,30 @@ public final class QuotaProperties { private LimitJsonObject limit; /* - * The quota units, such as Count and Bytes. When requesting quota, use the - * **unit** value returned in the GET response in the request body of your - * PUT operation. + * The quota units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET + * response in the request body of your PUT operation. */ @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; /* - * Resource name provided by the resource provider. Use this property name - * when requesting quota. + * Resource name provided by the resource provider. Use this property name when requesting quota. */ @JsonProperty(value = "name") private ResourceName name; /* - * Resource type name. + * The name of the resource type. Optional field. */ @JsonProperty(value = "resourceType") private String resourceType; /* - * The time period over which the quota usage values are summarized. For - * example: + * The time period over which the quota usage values are summarized. For example: * *P1D (per one day) * *PT1M (per one minute) * *PT1S (per one second). - * This parameter is optional because, for some resources like compute, the - * period is irrelevant. + * This parameter is optional because, for some resources like compute, the period is irrelevant. */ @JsonProperty(value = "quotaPeriod", access = JsonProperty.Access.WRITE_ONLY) private String quotaPeriod; @@ -65,6 +57,10 @@ public final class QuotaProperties { @JsonProperty(value = "properties") private Object properties; + /** Creates an instance of QuotaProperties class. */ + public QuotaProperties() { + } + /** * Get the limit property: Resource quota limit properties. * @@ -118,7 +114,7 @@ public QuotaProperties withName(ResourceName name) { } /** - * Get the resourceType property: Resource type name. + * Get the resourceType property: The name of the resource type. Optional field. * * @return the resourceType value. */ @@ -127,7 +123,7 @@ public String resourceType() { } /** - * Set the resourceType property: Resource type name. + * Set the resourceType property: The name of the resource type. Optional field. * * @param resourceType the resourceType value to set. * @return the QuotaProperties object itself. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetailsList.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetailsList.java index 1ff93e8cef76..6608e48df1e5 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetailsList.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestDetailsList.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.models.QuotaRequestDetailsInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Quota request information. */ @Fluent public final class QuotaRequestDetailsList { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotaRequestDetailsList.class); - /* * Quota request details. */ @@ -23,12 +19,15 @@ public final class QuotaRequestDetailsList { private List value; /* - * The URI for fetching the next page of quota limits. When there are no - * more pages, this string is null. + * The URI for fetching the next page of quota limits. When there are no more pages, this string is null. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of QuotaRequestDetailsList class. */ + public QuotaRequestDetailsList() { + } + /** * Get the value property: Quota request details. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java index 32143beccd3d..f15d85227459 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestState.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for QuotaRequestState. */ +/** Quota request status. */ public final class QuotaRequestState extends ExpandableStringEnum { /** Static value Accepted for QuotaRequestState. */ public static final QuotaRequestState ACCEPTED = fromString("Accepted"); @@ -25,6 +25,15 @@ public final class QuotaRequestState extends ExpandableStringEnum values() { return values(QuotaRequestState.class); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java index db676473c83e..03621a5417db 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotaRequestStatus.java @@ -19,13 +19,14 @@ public interface QuotaRequestStatus { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota request details and status by quota request ID for the resources of the resource provider at a - * specific location. + * specific location along with {@link Response}. */ - QuotaRequestDetails get(String id, String scope); + Response getWithResponse(String id, String scope, Context context); /** * Get the quota request details and status by quota request ID for the resources of the resource provider at a @@ -36,14 +37,13 @@ public interface QuotaRequestStatus { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 quota request details and status by quota request ID for the resources of the resource provider at a * specific location. */ - Response getWithResponse(String id, String scope, Context context); + QuotaRequestDetails get(String id, String scope); /** * For the specified scope, get the current quota requests for a one year period ending at the time is made. Use the @@ -56,7 +56,7 @@ public interface QuotaRequestStatus { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ PagedIterable list(String scope); @@ -79,7 +79,7 @@ public interface QuotaRequestStatus { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota request information. + * @return quota request information as paginated response with {@link PagedIterable}. */ PagedIterable list( String scope, String filter, Integer top, String skiptoken, Context context); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java index cbcbcb41a60f..42775b2e8e02 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Quotas.java @@ -20,12 +20,13 @@ public interface Quotas { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 quota limit of a resource. */ - CurrentQuotaLimitBase get(String resourceName, String scope); + Response getWithResponse(String resourceName, String scope, Context context); /** * Get the quota limit of a resource. The response can be used to determine the remaining quota to calculate a new @@ -37,13 +38,12 @@ public interface Quotas { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 quota limit of a resource. */ - Response getWithResponse(String resourceName, String scope, Context context); + CurrentQuotaLimitBase get(String resourceName, String scope); /** * Get a list of current quota limits of all resources for the specified scope. The response from this GET operation @@ -56,7 +56,8 @@ public interface Quotas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String scope); @@ -72,7 +73,8 @@ public interface Quotas { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current quota limits of all resources for the specified scope. + * @return a list of current quota limits of all resources for the specified scope as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String scope, Context context); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java index ee95a9ffa07c..686c1fe79678 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The QuotasGetHeaders model. */ @Fluent public final class QuotasGetHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotasGetHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of QuotasGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public QuotasGetHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java index d5534923de5a..533ce3638596 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasGetResponse.java @@ -29,7 +29,11 @@ public QuotasGetResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public CurrentQuotaLimitBaseInner getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListHeaders.java index a73b3373e416..6daba64faef9 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The QuotasListHeaders model. */ @Fluent public final class QuotasListHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotasListHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of QuotasListHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public QuotasListHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextHeaders.java index 018bb1bd9c1e..40af89d8edd4 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The QuotasListNextHeaders model. */ @Fluent public final class QuotasListNextHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(QuotasListNextHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of QuotasListNextHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public QuotasListNextHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextResponse.java index b8fa7412221c..66839c723115 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListNextResponse.java @@ -24,7 +24,11 @@ public QuotasListNextResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public QuotaLimits getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListResponse.java index b0437fb25589..0ba71d9a11bb 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/QuotasListResponse.java @@ -24,7 +24,11 @@ public QuotasListResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public QuotaLimits getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java index d3e34eec6145..eab57c4daa23 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ResourceName.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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; /** Name of the resource provided by the resource Provider. When requesting quota, use this property name. */ @Fluent public final class ResourceName { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ResourceName.class); - /* * Resource name. */ @@ -26,6 +22,10 @@ public final class ResourceName { @JsonProperty(value = "localizedValue", access = JsonProperty.Access.WRITE_ONLY) private String localizedValue; + /** Creates an instance of ResourceName class. */ + public ResourceName() { + } + /** * Get the value property: Resource name. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java index e2038ff844b4..0ea3c62b7983 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/ServiceErrorDetail.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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; /** Error details. */ @Immutable public final class ServiceErrorDetail { - @JsonIgnore private final ClientLogger logger = new ClientLogger(ServiceErrorDetail.class); - /* * Error code. */ @@ -26,6 +22,10 @@ public final class ServiceErrorDetail { @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) private String message; + /** Creates an instance of ServiceErrorDetail class. */ + public ServiceErrorDetail() { + } + /** * Get the code property: Error code. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java index 01d50fe11b91..d6a0e1dee6f4 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/SubRequest.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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; /** Request property. */ @Fluent public final class SubRequest { - @JsonIgnore private final ClientLogger logger = new ClientLogger(SubRequest.class); - /* * Resource name. */ @@ -27,9 +23,8 @@ public final class SubRequest { private String resourceType; /* - * Quota limit units, such as Count and Bytes. When requesting quota, use - * the **unit** value returned in the GET response in the request body of - * your PUT operation. + * Quota limit units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET + * response in the request body of your PUT operation. */ @JsonProperty(value = "unit") private String unit; @@ -58,6 +53,10 @@ public final class SubRequest { @JsonProperty(value = "limit") private LimitJsonObject limit; + /** Creates an instance of SubRequest class. */ + public SubRequest() { + } + /** * Get the name property: Resource name. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java index c54a52fb71c6..f3cccdfa0546 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/Usages.java @@ -19,12 +19,13 @@ public interface Usages { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. + * @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 current usage of a resource. */ - CurrentUsagesBase get(String resourceName, String scope); + Response getWithResponse(String resourceName, String scope, Context context); /** * Get the current usage of a resource. @@ -35,13 +36,12 @@ public interface Usages { * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`. * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added after * `/quotas`, then it's the target Azure resource URI in the GET operation for the specific resource. - * @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 current usage of a resource. */ - Response getWithResponse(String resourceName, String scope, Context context); + CurrentUsagesBase get(String resourceName, String scope); /** * Get a list of current usage for all resources for the scope specified. @@ -53,7 +53,8 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String scope); @@ -68,7 +69,8 @@ public interface Usages { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 list of current usage for all resources for the scope specified. + * @return a list of current usage for all resources for the scope specified as paginated response with {@link + * PagedIterable}. */ PagedIterable list(String scope, Context context); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java index b5f5379a66c1..ec84eff8f0d2 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The UsagesGetHeaders model. */ @Fluent public final class UsagesGetHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesGetHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of UsagesGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public UsagesGetHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java index e827afcc47bd..d6b4d582ce6d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesGetResponse.java @@ -29,7 +29,11 @@ public UsagesGetResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public CurrentUsagesBaseInner getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesLimits.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesLimits.java index 31fe3fb4dd3c..312f417b6a77 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesLimits.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesLimits.java @@ -5,17 +5,13 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.quota.fluent.models.CurrentUsagesBaseInner; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; /** Quota limits. */ @Fluent public final class UsagesLimits { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesLimits.class); - /* * List of quota limits. */ @@ -23,12 +19,15 @@ public final class UsagesLimits { private List value; /* - * The URI used to fetch the next page of quota limits. When there are no - * more pages, this is null. + * The URI used to fetch the next page of quota limits. When there are no more pages, this is null. */ @JsonProperty(value = "nextLink") private String nextLink; + /** Creates an instance of UsagesLimits class. */ + public UsagesLimits() { + } + /** * Get the value property: List of quota limits. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListHeaders.java index d8050885e947..9c501ccdc52b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The UsagesListHeaders model. */ @Fluent public final class UsagesListHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of UsagesListHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public UsagesListHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextHeaders.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextHeaders.java index 9516de7ad725..feb6842317d5 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextHeaders.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextHeaders.java @@ -5,21 +5,29 @@ package com.azure.resourcemanager.quota.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonIgnore; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.fasterxml.jackson.annotation.JsonProperty; /** The UsagesListNextHeaders model. */ @Fluent public final class UsagesListNextHeaders { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesListNextHeaders.class); - /* * The Etag property. */ @JsonProperty(value = "Etag") private String etag; + // HttpHeaders containing the raw property values. + /** + * Creates an instance of UsagesListNextHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public UsagesListNextHeaders(HttpHeaders rawHeaders) { + this.etag = rawHeaders.getValue(HttpHeaderName.ETAG); + } + /** * Get the etag property: The Etag property. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextResponse.java index 7f7ef3b7cff1..5162c2b31f2b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListNextResponse.java @@ -28,7 +28,11 @@ public UsagesListNextResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public UsagesLimits getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListResponse.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListResponse.java index 65c6d29e22ff..190d81386204 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListResponse.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesListResponse.java @@ -24,7 +24,11 @@ public UsagesListResponse( super(request, statusCode, rawHeaders, value, headers); } - /** @return the deserialized response body. */ + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ @Override public UsagesLimits getValue() { return super.getValue(); diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java index 083ba5f69eb5..78406bb9f854 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesObject.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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 resource usages value. */ @Fluent public final class UsagesObject { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesObject.class); - /* * The usages value. */ @@ -26,6 +22,10 @@ public final class UsagesObject { @JsonProperty(value = "usagesType") private UsagesTypes usagesType; + /** Creates an instance of UsagesObject class. */ + public UsagesObject() { + } + /** * Get the value property: The usages value. * diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java index bbc087af5139..f0367cfc9427 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesProperties.java @@ -5,15 +5,11 @@ package com.azure.resourcemanager.quota.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; /** Usage properties for the specified resource. */ @Fluent public final class UsagesProperties { - @JsonIgnore private final ClientLogger logger = new ClientLogger(UsagesProperties.class); - /* * The quota limit properties for this resource. */ @@ -21,22 +17,20 @@ public final class UsagesProperties { private UsagesObject usages; /* - * The units for the quota usage, such as Count and Bytes. When requesting - * quota, use the **unit** value returned in the GET response in the - * request body of your PUT operation. + * The units for the quota usage, such as Count and Bytes. When requesting quota, use the **unit** value returned + * in the GET response in the request body of your PUT operation. */ @JsonProperty(value = "unit", access = JsonProperty.Access.WRITE_ONLY) private String unit; /* - * Resource name provided by the resource provider. Use this property name - * when requesting quota. + * Resource name provided by the resource provider. Use this property name when requesting quota. */ @JsonProperty(value = "name") private ResourceName name; /* - * The name of the resource type. + * The name of the resource type. Optional field. */ @JsonProperty(value = "resourceType") private String resourceType; @@ -46,8 +40,7 @@ public final class UsagesProperties { * *P1D (per one day) * *PT1M (per one minute) * *PT1S (per one second). - * This parameter is optional because it is not relevant for all resources - * such as compute. + * This parameter is optional because it is not relevant for all resources such as compute. */ @JsonProperty(value = "quotaPeriod", access = JsonProperty.Access.WRITE_ONLY) private String quotaPeriod; @@ -64,6 +57,10 @@ public final class UsagesProperties { @JsonProperty(value = "properties") private Object properties; + /** Creates an instance of UsagesProperties class. */ + public UsagesProperties() { + } + /** * Get the usages property: The quota limit properties for this resource. * @@ -117,7 +114,7 @@ public UsagesProperties withName(ResourceName name) { } /** - * Get the resourceType property: The name of the resource type. + * Get the resourceType property: The name of the resource type. Optional field. * * @return the resourceType value. */ @@ -126,7 +123,7 @@ public String resourceType() { } /** - * Set the resourceType property: The name of the resource type. + * Set the resourceType property: The name of the resource type. Optional field. * * @param resourceType the resourceType value to set. * @return the UsagesProperties object itself. diff --git a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java index 0626f69c2b51..99ba12a5d961 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java +++ b/sdk/quota/azure-resourcemanager-quota/src/main/java/com/azure/resourcemanager/quota/models/UsagesTypes.java @@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for UsagesTypes. */ +/** The quota or usages limit types. */ public final class UsagesTypes extends ExpandableStringEnum { /** Static value Individual for UsagesTypes. */ public static final UsagesTypes INDIVIDUAL = fromString("Individual"); @@ -16,6 +16,15 @@ public final class UsagesTypes extends ExpandableStringEnum { /** Static value Combined for UsagesTypes. */ public static final UsagesTypes COMBINED = fromString("Combined"); + /** + * Creates a new instance of UsagesTypes value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public UsagesTypes() { + } + /** * Creates or finds a UsagesTypes from its string representation. * @@ -27,7 +36,11 @@ public static UsagesTypes fromString(String name) { return fromString(name, UsagesTypes.class); } - /** @return known UsagesTypes values. */ + /** + * Gets known UsagesTypes values. + * + * @return known UsagesTypes values. + */ public static Collection values() { return values(UsagesTypes.class); } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java index 2cef6ae485b5..e18805cd65c1 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaCreateOrUpdateSamples.java @@ -11,7 +11,7 @@ /** Samples for Quota CreateOrUpdate. */ public final class QuotaCreateOrUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putMachineLearningServicesQuotaRequestLowPriority.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putMachineLearningServicesQuotaRequestLowPriority.json */ /** * Sample code: Quotas_Request_ForMachineLearningServices_LowPriorityResource. @@ -34,7 +34,7 @@ public static void quotasRequestForMachineLearningServicesLowPriorityResource( } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequestStandardSkuPublicIpAddresses.json */ /** * Sample code: Quotas_PutRequest_ForNetwork_StandardSkuPublicIpAddressesResource. @@ -57,7 +57,7 @@ public static void quotasPutRequestForNetworkStandardSkuPublicIpAddressesResourc } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putComputeOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putComputeOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Put_Request_ForCompute. @@ -78,7 +78,7 @@ public static void quotasPutRequestForCompute(com.azure.resourcemanager.quota.Qu } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/putNetworkOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/putNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_PutRequest_ForNetwork. diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java index 6d4daed7ae20..627ad493dc3d 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for Quota Get. */ public final class QuotaGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuQuotaLimit.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuQuotaLimit.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -22,11 +20,11 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuQuotaLimit.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuQuotaLimit.json */ /** * Sample code: Quotas_Get_Request_ForCompute. @@ -39,6 +37,6 @@ public static void quotasGetRequestForCompute(com.azure.resourcemanager.quota.Qu .getWithResponse( "standardNDSFamily", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java index c20195f134cd..0a646aece7ea 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for Quota List. */ public final class QuotaListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsMachineLearningServices. @@ -22,11 +20,11 @@ public static void quotasListQuotaLimitsMachineLearningServices( .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForCompute. @@ -38,11 +36,11 @@ public static void quotasListQuotaLimitsForCompute(com.azure.resourcemanager.quo .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkQuotaLimits.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkQuotaLimits.json */ /** * Sample code: Quotas_listQuotaLimitsForNetwork. @@ -54,6 +52,6 @@ public static void quotasListQuotaLimitsForNetwork(com.azure.resourcemanager.quo .quotas() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java index 7d8527573653..1630ad36bf2b 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaOperationListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for QuotaOperation List. */ public final class QuotaOperationListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/GetOperations.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/GetOperations.json */ /** * Sample code: GetOperations. @@ -17,6 +15,6 @@ public final class QuotaOperationListSamples { * @param manager Entry point to QuotaManager. */ public static void getOperations(com.azure.resourcemanager.quota.QuotaManager manager) { - manager.quotaOperations().list(Context.NONE); + manager.quotaOperations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java index 51ba2e648900..7fc11788ea73 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for QuotaRequestStatus Get. */ public final class QuotaRequestStatusGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusFailed.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusFailed.json */ /** * Sample code: QuotaRequestFailed. @@ -22,11 +20,11 @@ public static void quotaRequestFailed(com.azure.resourcemanager.quota.QuotaManag .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusById.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusById.json */ /** * Sample code: QuotaRequestStatus. @@ -39,11 +37,11 @@ public static void quotaRequestStatus(com.azure.resourcemanager.quota.QuotaManag .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestStatusInProgress.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestStatusInProgress.json */ /** * Sample code: QuotaRequestInProgress. @@ -56,6 +54,6 @@ public static void quotaRequestInProgress(com.azure.resourcemanager.quota.QuotaM .getWithResponse( "2B5C8515-37D8-4B6A-879B-CD641A2CF605", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java index 71a01584ee92..2f261208798a 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaRequestStatusListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for QuotaRequestStatus List. */ public final class QuotaRequestStatusListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getQuotaRequestsHistory.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getQuotaRequestsHistory.json */ /** * Sample code: QuotaRequestHistory. @@ -24,6 +22,6 @@ public static void quotaRequestHistory(com.azure.resourcemanager.quota.QuotaMana null, null, null, - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java index e6538690856c..afe10f191cbd 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/QuotaUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; import com.azure.resourcemanager.quota.models.CurrentQuotaLimitBase; import com.azure.resourcemanager.quota.models.LimitObject; import com.azure.resourcemanager.quota.models.QuotaProperties; @@ -13,7 +12,7 @@ /** Samples for Quota Update. */ public final class QuotaUpdateSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchComputeQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchComputeQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForCompute. @@ -27,7 +26,7 @@ public static void quotasRequestPatchForCompute(com.azure.resourcemanager.quota. .getWithResponse( "standardFSv2Family", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Compute/locations/eastus", - Context.NONE) + com.azure.core.util.Context.NONE) .getValue(); resource .update() @@ -39,7 +38,7 @@ public static void quotasRequestPatchForCompute(com.azure.resourcemanager.quota. } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/patchNetworkOneSkuQuotaRequest.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/patchNetworkOneSkuQuotaRequest.json */ /** * Sample code: Quotas_Request_PatchForNetwork. @@ -53,7 +52,7 @@ public static void quotasRequestPatchForNetwork(com.azure.resourcemanager.quota. .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/D7EC67B3-7657-4966-BFFC-41EFD36BAAB3/providers/Microsoft.Network/locations/eastus", - Context.NONE) + com.azure.core.util.Context.NONE) .getValue(); resource .update() diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java index a2b59b2d2b60..42717c031cbb 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesGetSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for Usages Get. */ public final class UsagesGetSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkOneSkuUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForNetwork. @@ -22,11 +20,11 @@ public static void quotasUsagesRequestForNetwork(com.azure.resourcemanager.quota .getWithResponse( "MinPublicIpInterNetworkPrefixLength", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeOneSkuUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeOneSkuUsages.json */ /** * Sample code: Quotas_UsagesRequest_ForCompute. @@ -39,6 +37,6 @@ public static void quotasUsagesRequestForCompute(com.azure.resourcemanager.quota .getWithResponse( "standardNDSFamily", "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } } diff --git a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java index 9741538fe605..3ca44557cc75 100644 --- a/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java +++ b/sdk/quota/azure-resourcemanager-quota/src/samples/java/com/azure/resourcemanager/quota/generated/UsagesListSamples.java @@ -4,12 +4,10 @@ package com.azure.resourcemanager.quota.generated; -import com.azure.core.util.Context; - /** Samples for Usages List. */ public final class UsagesListSamples { /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getComputeUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getComputeUsages.json */ /** * Sample code: Quotas_listUsagesForCompute. @@ -21,11 +19,11 @@ public static void quotasListUsagesForCompute(com.azure.resourcemanager.quota.Qu .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getNetworkUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getNetworkUsages.json */ /** * Sample code: Quotas_listUsagesForNetwork. @@ -37,11 +35,11 @@ public static void quotasListUsagesForNetwork(com.azure.resourcemanager.quota.Qu .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } /* - * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/preview/2021-03-15-preview/examples/getMachineLearningServicesUsages.json + * x-ms-original-file: specification/quota/resource-manager/Microsoft.Quota/stable/2023-02-01/examples/getMachineLearningServicesUsages.json */ /** * Sample code: Quotas_listUsagesMachineLearningServices. @@ -53,6 +51,6 @@ public static void quotasListUsagesMachineLearningServices(com.azure.resourceman .usages() .list( "subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.MachineLearningServices/locations/eastus", - Context.NONE); + com.azure.core.util.Context.NONE); } }