diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md index 50ece4e63586f..c158769bb762f 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2024-11-26) + +- Azure Resource Manager Playwright Testing client library for Java. This package contains Microsoft Azure SDK for Playwright Testing Management SDK. Azure Playwright testing management service. Package tag package-2024-12-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/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md index 16e6d83430332..cd511b0785fd2 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Playwright Testing client library for Java. -This package contains Microsoft Azure SDK for Playwright Testing Management SDK. Azure Playwright testing management service. Package tag package-2023-10-01-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 Playwright Testing Management SDK. Azure Playwright testing management service. Package tag package-2024-12-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-playwrighttesting - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. +Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package. -- `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. +Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. -In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable. - -With above configuration, `azure` client can be authenticated using the following code: +Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials [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 diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md index e7edbb6d71aba..e970cf2bc6e4c 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md @@ -1,8 +1,14 @@ # Code snippets and samples +## AccountQuotas + +- [Get](#accountquotas_get) +- [ListByAccount](#accountquotas_listbyaccount) + ## Accounts +- [CheckNameAvailability](#accounts_checknameavailability) - [CreateOrUpdate](#accounts_createorupdate) - [Delete](#accounts_delete) - [GetByResourceGroup](#accounts_getbyresourcegroup) @@ -18,6 +24,85 @@ - [Get](#quotas_get) - [ListBySubscription](#quotas_listbysubscription) +### AccountQuotas_Get + +```java +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; + +/** + * Samples for AccountQuotas Get. + */ +public final class AccountQuotasGetSamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * AccountQuotas_Get.json + */ + /** + * Sample code: AccountQuotas_Get. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void accountQuotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accountQuotas() + .getWithResponse("dummyrg", "myPlaywrightAccount", QuotaNames.SCALABLE_EXECUTION, + com.azure.core.util.Context.NONE); + } +} +``` + +### AccountQuotas_ListByAccount + +```java +/** + * Samples for AccountQuotas ListByAccount. + */ +public final class AccountQuotasListByAccountSamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * AccountQuotas_ListByAccount.json + */ + /** + * Sample code: AccountQuotas_ListByAccount. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void + accountQuotasListByAccount(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accountQuotas().listByAccount("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); + } +} +``` + +### Accounts_CheckNameAvailability + +```java +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityRequest; + +/** + * Samples for Accounts CheckNameAvailability. + */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_CheckNameAvailability.json + */ + /** + * Sample code: Accounts_CheckNameAvailability. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void + accountsCheckNameAvailability(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("dummyName") + .withType("Microsoft.AzurePlaywrightService/Accounts"), com.azure.core.util.Context.NONE); + } +} +``` + ### Accounts_CreateOrUpdate ```java @@ -32,8 +117,8 @@ import java.util.Map; public final class AccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_CreateOrUpdate.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_CreateOrUpdate.json */ /** * Sample code: Accounts_CreateOrUpdate. @@ -42,9 +127,13 @@ public final class AccountsCreateOrUpdateSamples { */ public static void accountsCreateOrUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.accounts().define("myPlaywrightAccount").withRegion("westus").withExistingResourceGroup("dummyrg") + manager.accounts() + .define("myPlaywrightAccount") + .withRegion("westus") + .withExistingResourceGroup("dummyrg") .withTags(mapOf("Team", "Dev Exp")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)).create(); + .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .create(); } // Use "Map.of" if available @@ -70,8 +159,8 @@ public final class AccountsCreateOrUpdateSamples { public final class AccountsDeleteSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Delete.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Delete.json */ /** * Sample code: Accounts_Delete. @@ -93,8 +182,8 @@ public final class AccountsDeleteSamples { public final class AccountsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Get.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Get.json */ /** * Sample code: Accounts_Get. @@ -102,8 +191,8 @@ public final class AccountsGetByResourceGroupSamples { * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.accounts().getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", - com.azure.core.util.Context.NONE); + manager.accounts() + .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); } } ``` @@ -117,8 +206,8 @@ public final class AccountsGetByResourceGroupSamples { public final class AccountsListSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_ListBySubscription.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_ListBySubscription.json */ /** * Sample code: Accounts_ListBySubscription. @@ -141,8 +230,8 @@ public final class AccountsListSamples { public final class AccountsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_ListByResourceGroup.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_ListByResourceGroup.json */ /** * Sample code: Accounts_ListByResourceGroup. @@ -171,8 +260,8 @@ import java.util.Map; public final class AccountsUpdateSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Update.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Update.json */ /** * Sample code: Accounts_Update. @@ -183,8 +272,10 @@ public final class AccountsUpdateSamples { Account resource = manager.accounts() .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Division", "LT", "Team", "Dev Exp")) - .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)).apply(); + resource.update() + .withTags(mapOf("Division", "LT", "Team", "Dev Exp")) + .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .apply(); } // Use "Map.of" if available @@ -210,8 +301,8 @@ public final class AccountsUpdateSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Operations_List.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Operations_List.json */ /** * Sample code: Operations_List. @@ -235,8 +326,8 @@ import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; public final class QuotasGetSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Quotas_Get.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Quotas_Get.json */ /** * Sample code: Quotas_Get. @@ -258,8 +349,8 @@ public final class QuotasGetSamples { public final class QuotasListBySubscriptionSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Quotas_ListBySubscription.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Quotas_ListBySubscription.json */ /** * Sample code: Quotas_ListBySubscription. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml index 81ed0443808c7..54b786f41b60a 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Playwright Testing Management - This package contains Microsoft Azure SDK for Playwright Testing Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Playwright testing management service. Package tag package-2023-10-01-preview. + This package contains Microsoft Azure SDK for Playwright Testing Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Playwright testing management service. Package tag package-2024-12-01. https://github.com/Azure/azure-sdk-for-java @@ -46,6 +46,7 @@ 0 0 true + false diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/PlaywrightTestingManager.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/PlaywrightTestingManager.java index e3c1f99225f5b..f763b9f8f1711 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/PlaywrightTestingManager.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/PlaywrightTestingManager.java @@ -11,6 +11,7 @@ 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.BearerTokenAuthenticationPolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; import com.azure.core.http.policy.HttpPipelinePolicy; @@ -19,15 +20,16 @@ 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; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.playwrighttesting.fluent.PlaywrightTestingMgmtClient; +import com.azure.resourcemanager.playwrighttesting.implementation.AccountQuotasImpl; import com.azure.resourcemanager.playwrighttesting.implementation.AccountsImpl; import com.azure.resourcemanager.playwrighttesting.implementation.OperationsImpl; import com.azure.resourcemanager.playwrighttesting.implementation.PlaywrightTestingMgmtClientBuilder; import com.azure.resourcemanager.playwrighttesting.implementation.QuotasImpl; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotas; import com.azure.resourcemanager.playwrighttesting.models.Accounts; import com.azure.resourcemanager.playwrighttesting.models.Operations; import com.azure.resourcemanager.playwrighttesting.models.Quotas; @@ -49,6 +51,8 @@ public final class PlaywrightTestingManager { private Quotas quotas; + private AccountQuotas accountQuotas; + private final PlaywrightTestingMgmtClient clientObject; private PlaywrightTestingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -213,7 +217,7 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr .append("-") .append("com.azure.resourcemanager.playwrighttesting") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -246,7 +250,7 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) .collect(Collectors.toList())); @@ -295,6 +299,18 @@ public Quotas quotas() { return quotas; } + /** + * Gets the resource collection API of AccountQuotas. + * + * @return Resource collection API of AccountQuotas. + */ + public AccountQuotas accountQuotas() { + if (this.accountQuotas == null) { + this.accountQuotas = new AccountQuotasImpl(clientObject.getAccountQuotas(), this); + } + return accountQuotas; + } + /** * Gets wrapped service client PlaywrightTestingMgmtClient providing direct access to the underlying auto-generated * API implementation, based on Azure REST API. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountQuotasClient.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountQuotasClient.java new file mode 100644 index 0000000000000..cadd3ebe2d8f4 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountQuotasClient.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; + +/** + * An instance of this class provides access to all the operations defined in AccountQuotasClient. + */ +public interface AccountQuotasClient { + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, QuotaNames quotaName, + Context context); + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AccountQuotaInner get(String resourceGroupName, String accountName, QuotaNames quotaName); +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountsClient.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountsClient.java index fe3e33210a169..9023000f7f928 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountsClient.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/AccountsClient.java @@ -12,7 +12,9 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; +import com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.playwrighttesting.models.AccountUpdate; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityRequest; /** * An instance of this class provides access to all the operations defined in AccountsClient. @@ -40,6 +42,32 @@ public interface AccountsClient { @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @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 check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, + Context context); + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body); + /** * List Account resources by resource group. * @@ -69,7 +97,7 @@ public interface AccountsClient { * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -77,129 +105,130 @@ public interface AccountsClient { * @return a Account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context); /** * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Account. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner getByResourceGroup(String resourceGroupName, String name); + AccountInner getByResourceGroup(String resourceGroupName, String accountName); /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an account resource. + * @return the {@link SyncPoller} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String name, + SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String accountName, AccountInner resource); /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an account resource. + * @return the {@link SyncPoller} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String name, + SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String accountName, AccountInner resource, Context context); /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner createOrUpdate(String resourceGroupName, String name, AccountInner resource); + AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner resource); /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @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 an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner createOrUpdate(String resourceGroupName, String name, AccountInner resource, Context context); + AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner resource, Context context); /** * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @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 an account resource along with {@link Response}. + * @return a Playwright service account resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse(String resourceGroupName, String name, AccountUpdate properties, + Response updateWithResponse(String resourceGroupName, String accountName, AccountUpdate properties, Context context); /** * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - AccountInner update(String resourceGroupName, String name, AccountUpdate properties); + AccountInner update(String resourceGroupName, String accountName, AccountUpdate properties); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String name); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -207,30 +236,30 @@ Response updateWithResponse(String resourceGroupName, String name, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, Context context); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name); + void delete(String resourceGroupName, String accountName); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String name, Context context); + void delete(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/PlaywrightTestingMgmtClient.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/PlaywrightTestingMgmtClient.java index 9f9f05c5260ee..b7bcc570fda9d 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/PlaywrightTestingMgmtClient.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/PlaywrightTestingMgmtClient.java @@ -12,7 +12,7 @@ */ public interface PlaywrightTestingMgmtClient { /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -66,4 +66,11 @@ public interface PlaywrightTestingMgmtClient { * @return the QuotasClient object. */ QuotasClient getQuotas(); + + /** + * Gets the AccountQuotasClient object to access its operations. + * + * @return the AccountQuotasClient object. + */ + AccountQuotasClient getAccountQuotas(); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/QuotasClient.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/QuotasClient.java index 4c9597775fb17..16096a0d36399 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/QuotasClient.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/QuotasClient.java @@ -42,29 +42,29 @@ public interface QuotasClient { PagedIterable listBySubscription(String location, Context context); /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name along with {@link Response}. + * @return subscription quota by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, QuotaNames name, Context context); + Response getWithResponse(String location, QuotaNames quotaName, Context context); /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name. + * @return subscription quota by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - QuotaInner get(String location, QuotaNames name); + QuotaInner get(String location, QuotaNames quotaName); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountInner.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountInner.java index 812af5b52d269..bc7d04332010b 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountInner.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountInner.java @@ -7,27 +7,43 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.Map; /** - * An account resource. + * A Playwright service account resource. */ @Fluent public final class AccountInner extends Resource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private AccountProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of AccountInner class. */ @@ -63,6 +79,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * {@inheritDoc} */ @@ -91,4 +137,56 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountInner. + */ + public static AccountInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountInner deserializedAccountInner = new AccountInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccountInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAccountInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccountInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedAccountInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedAccountInner.properties = AccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccountInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountInner; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountQuotaInner.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountQuotaInner.java new file mode 100644 index 0000000000000..8aae5bedf75b0 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountQuotaInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotaProperties; +import java.io.IOException; + +/** + * A quota resource for a Playwright service account. + */ +@Fluent +public final class AccountQuotaInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + private AccountQuotaProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of AccountQuotaInner class. + */ + public AccountQuotaInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public AccountQuotaProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the AccountQuotaInner object itself. + */ + public AccountQuotaInner withProperties(AccountQuotaProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountQuotaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountQuotaInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountQuotaInner. + */ + public static AccountQuotaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountQuotaInner deserializedAccountQuotaInner = new AccountQuotaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccountQuotaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedAccountQuotaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedAccountQuotaInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccountQuotaInner.properties = AccountQuotaProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedAccountQuotaInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountQuotaInner; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/CheckNameAvailabilityResponseInner.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/CheckNameAvailabilityResponseInner.java new file mode 100644 index 0000000000000..22cd8c8c4e810 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityReason; +import java.io.IOException; + +/** + * The check availability result. + */ +@Fluent +public final class CheckNameAvailabilityResponseInner implements JsonSerializable { + /* + * Indicates if the resource name is available. + */ + private Boolean nameAvailable; + + /* + * The reason why the given name is not available. + */ + private CheckNameAvailabilityReason reason; + + /* + * Detailed reason why the given name is available. + */ + private String message; + + /** + * Creates an instance of CheckNameAvailabilityResponseInner class. + */ + public CheckNameAvailabilityResponseInner() { + } + + /** + * Get the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the nameAvailable property: Indicates if the resource name is available. + * + * @param nameAvailable the nameAvailable value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + public CheckNameAvailabilityReason reason() { + return this.reason; + } + + /** + * Set the reason property: The reason why the given name is not available. + * + * @param reason the reason value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withReason(CheckNameAvailabilityReason reason) { + this.reason = reason; + return this; + } + + /** + * Get the message property: Detailed reason why the given name is available. + * + * @return the message value. + */ + public String message() { + return this.message; + } + + /** + * Set the message property: Detailed reason why the given name is available. + * + * @param message the message value to set. + * @return the CheckNameAvailabilityResponseInner object itself. + */ + public CheckNameAvailabilityResponseInner withMessage(String message) { + this.message = message; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("nameAvailable", this.nameAvailable); + jsonWriter.writeStringField("reason", this.reason == null ? null : this.reason.toString()); + jsonWriter.writeStringField("message", this.message); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityResponseInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityResponseInner. + */ + public static CheckNameAvailabilityResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityResponseInner deserializedCheckNameAvailabilityResponseInner + = new CheckNameAvailabilityResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("nameAvailable".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.nameAvailable + = reader.getNullable(JsonReader::getBoolean); + } else if ("reason".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.reason + = CheckNameAvailabilityReason.fromString(reader.getString()); + } else if ("message".equals(fieldName)) { + deserializedCheckNameAvailabilityResponseInner.message = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityResponseInner; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/OperationInner.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/OperationInner.java index dd534be1537dd..51d6d1b3d019a 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/OperationInner.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/OperationInner.java @@ -5,10 +5,14 @@ package com.azure.resourcemanager.playwrighttesting.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.playwrighttesting.models.ActionType; import com.azure.resourcemanager.playwrighttesting.models.OperationDisplay; import com.azure.resourcemanager.playwrighttesting.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** * REST API Operation @@ -16,38 +20,33 @@ * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent -public final class OperationInner { +public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for * ARM/control-plane operations. */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; /* * Localized display information for this particular operation. */ - @JsonProperty(value = "display") private OperationDisplay display; /* * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default * value is "user,system" */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; /* * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; /** @@ -126,4 +125,48 @@ public void validate() { display().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else if ("origin".equals(fieldName)) { + deserializedOperationInner.origin = Origin.fromString(reader.getString()); + } else if ("actionType".equals(fieldName)) { + deserializedOperationInner.actionType = ActionType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaInner.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaInner.java index 442276e0191b8..234e0a67131fe 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaInner.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaInner.java @@ -7,26 +7,42 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; /** - * A quota resource. + * A subscription quota resource. */ @Fluent public final class QuotaInner extends ProxyResource { /* * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private QuotaProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + /** * Creates an instance of QuotaInner class. */ @@ -62,6 +78,36 @@ public SystemData systemData() { return this.systemData; } + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + /** * Validates the instance. * @@ -72,4 +118,49 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaInner if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QuotaInner. + */ + public static QuotaInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaInner deserializedQuotaInner = new QuotaInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedQuotaInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedQuotaInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedQuotaInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedQuotaInner.properties = QuotaProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedQuotaInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaInner; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountImpl.java index f99f753f37c23..a7130c098417d 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountImpl.java @@ -75,7 +75,7 @@ private com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager man private String resourceGroupName; - private String name; + private String accountName; private AccountUpdate updateProperties; @@ -87,21 +87,21 @@ public AccountImpl withExistingResourceGroup(String resourceGroupName) { public Account create() { this.innerObject = serviceManager.serviceClient() .getAccounts() - .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + .createOrUpdate(resourceGroupName, accountName, this.innerModel(), Context.NONE); return this; } public Account create(Context context) { this.innerObject = serviceManager.serviceClient() .getAccounts() - .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + .createOrUpdate(resourceGroupName, accountName, this.innerModel(), context); return this; } AccountImpl(String name, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerObject = new AccountInner(); this.serviceManager = serviceManager; - this.name = name; + this.accountName = name; } public AccountImpl update() { @@ -112,7 +112,7 @@ public AccountImpl update() { public Account apply() { this.innerObject = serviceManager.serviceClient() .getAccounts() - .updateWithResponse(resourceGroupName, name, updateProperties, Context.NONE) + .updateWithResponse(resourceGroupName, accountName, updateProperties, Context.NONE) .getValue(); return this; } @@ -120,7 +120,7 @@ public Account apply() { public Account apply(Context context) { this.innerObject = serviceManager.serviceClient() .getAccounts() - .updateWithResponse(resourceGroupName, name, updateProperties, context) + .updateWithResponse(resourceGroupName, accountName, updateProperties, context) .getValue(); return this; } @@ -130,13 +130,13 @@ public Account apply(Context context) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.name = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); } public Account refresh() { this.innerObject = serviceManager.serviceClient() .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE) .getValue(); return this; } @@ -144,7 +144,7 @@ public Account refresh() { public Account refresh(Context context) { this.innerObject = serviceManager.serviceClient() .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getByResourceGroupWithResponse(resourceGroupName, accountName, context) .getValue(); return this; } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotaImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotaImpl.java new file mode 100644 index 0000000000000..fc26eb965fcd6 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotaImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuota; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotaProperties; + +public final class AccountQuotaImpl implements AccountQuota { + private AccountQuotaInner innerObject; + + private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; + + AccountQuotaImpl(AccountQuotaInner innerObject, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public AccountQuotaProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public AccountQuotaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasClientImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasClientImpl.java new file mode 100644 index 0000000000000..537b2f0af7482 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasClientImpl.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.playwrighttesting.fluent.AccountQuotasClient; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotaListResult; +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in AccountQuotasClient. + */ +public final class AccountQuotasClientImpl implements AccountQuotasClient { + /** + * The proxy service used to perform REST calls. + */ + private final AccountQuotasService service; + + /** + * The service client containing this operation class. + */ + private final PlaywrightTestingMgmtClientImpl client; + + /** + * Initializes an instance of AccountQuotasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + AccountQuotasClientImpl(PlaywrightTestingMgmtClientImpl client) { + this.service + = RestProxy.create(AccountQuotasService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for PlaywrightTestingMgmtClientAccountQuotas to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "PlaywrightTestingMgm") + public interface AccountQuotasService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccount(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("quotaName") QuotaNames quotaName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a AccountQuota list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @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 of a AccountQuota list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountSinglePageAsync(String resourceGroupName, + String accountName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByAccount(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a AccountQuota list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByAccountNextSinglePageAsync(nextLink)); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @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 of a AccountQuota list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName)); + } + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + QuotaNames quotaName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (quotaName == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, quotaName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + QuotaNames quotaName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + if (quotaName == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, quotaName, accept, context); + } + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String accountName, QuotaNames quotaName) { + return getWithResponseAsync(resourceGroupName, accountName, quotaName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + QuotaNames quotaName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, quotaName, context).block(); + } + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AccountQuotaInner get(String resourceGroupName, String accountName, QuotaNames quotaName) { + return getWithResponse(resourceGroupName, accountName, quotaName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 of a AccountQuota list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 of a AccountQuota list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByAccountNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasImpl.java new file mode 100644 index 0000000000000..abc45b728d42b --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasImpl.java @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.implementation; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.playwrighttesting.fluent.AccountQuotasClient; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuota; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotas; +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; + +public final class AccountQuotasImpl implements AccountQuotas { + private static final ClientLogger LOGGER = new ClientLogger(AccountQuotasImpl.class); + + private final AccountQuotasClient innerClient; + + private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; + + public AccountQuotasImpl(AccountQuotasClient innerClient, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName) { + PagedIterable inner = this.serviceClient().listByAccount(resourceGroupName, accountName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountQuotaImpl(inner1, this.manager())); + } + + public PagedIterable listByAccount(String resourceGroupName, String accountName, Context context) { + PagedIterable inner + = this.serviceClient().listByAccount(resourceGroupName, accountName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountQuotaImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String accountName, QuotaNames quotaName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, accountName, quotaName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AccountQuotaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AccountQuota get(String resourceGroupName, String accountName, QuotaNames quotaName) { + AccountQuotaInner inner = this.serviceClient().get(resourceGroupName, accountName, quotaName); + if (inner != null) { + return new AccountQuotaImpl(inner, this.manager()); + } else { + return null; + } + } + + private AccountQuotasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsClientImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsClientImpl.java index f73421d78e47f..4b97aabf4cfa3 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsClientImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -34,8 +35,10 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.playwrighttesting.fluent.AccountsClient; import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; +import com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.playwrighttesting.models.AccountListResult; import com.azure.resourcemanager.playwrighttesting.models.AccountUpdate; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -79,6 +82,15 @@ Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> checkNameAvailability(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") CheckNameAvailabilityRequest body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts") @ExpectedResponses({ 200 }) @@ -89,41 +101,41 @@ Mono> listByResourceGroup(@HostParam("$host") String Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getByResourceGroup(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @BodyParam("application/json") AccountInner resource, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @BodyParam("application/json") AccountUpdate properties, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") - @ExpectedResponses({ 200, 202, 204 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("name") String name, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -253,6 +265,114 @@ public PagedIterable list(Context context) { return new PagedIterable<>(listAsync(context)); } + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check availability result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @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 check availability result along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + checkNameAvailabilityWithResponseAsync(CheckNameAvailabilityRequest body, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), body, accept, context); + } + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check availability result on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono checkNameAvailabilityAsync(CheckNameAvailabilityRequest body) { + return checkNameAvailabilityWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @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 check availability result along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, Context context) { + return checkNameAvailabilityWithResponseAsync(body, context).block(); + } + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 check availability result. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CheckNameAvailabilityResponseInner checkNameAvailability(CheckNameAvailabilityRequest body) { + return checkNameAvailabilityWithResponse(body, Context.NONE).getValue(); + } + /** * List Account resources by resource group. * @@ -385,14 +505,15 @@ public PagedIterable listByResourceGroup(String resourceGroupName, * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -405,13 +526,13 @@ private Mono> getByResourceGroupWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -419,7 +540,7 @@ private Mono> getByResourceGroupWithResponseAsync(String * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -427,8 +548,8 @@ private Mono> getByResourceGroupWithResponseAsync(String * @return a Account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, String name, - Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String accountName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -441,28 +562,28 @@ private Mono> getByResourceGroupWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, accept, context); + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String name) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name) + private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -470,7 +591,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -478,40 +599,41 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * @return a Account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block(); } /** * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner getByResourceGroup(String resourceGroupName, String name) { - return getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + public AccountInner getByResourceGroup(String resourceGroupName, String accountName) { + return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); } /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource along with {@link Response} on successful completion of {@link Mono}. + * @return a Playwright service account resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, - AccountInner resource) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, AccountInner resource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -524,8 +646,8 @@ private Mono>> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } if (resource == null) { return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); @@ -535,7 +657,7 @@ private Mono>> createOrUpdateWithResponseAsync(String final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, accountName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -543,17 +665,18 @@ private Mono>> createOrUpdateWithResponseAsync(String * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @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 an account resource along with {@link Response} on successful completion of {@link Mono}. + * @return a Playwright service account resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String name, - AccountInner resource, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, AccountInner resource, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -566,8 +689,8 @@ private Mono>> createOrUpdateWithResponseAsync(String return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } if (resource == null) { return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); @@ -577,24 +700,25 @@ private Mono>> createOrUpdateWithResponseAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, resource, accept, context); + this.client.getSubscriptionId(), resourceGroupName, accountName, resource, accept, context); } /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an account resource. + * @return the {@link PollerFlux} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccountInner> beginCreateOrUpdateAsync(String resourceGroupName, - String name, AccountInner resource) { - Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, name, resource); + String accountName, AccountInner resource) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), AccountInner.class, AccountInner.class, this.client.getContext()); } @@ -603,20 +727,20 @@ private PollerFlux, AccountInner> beginCreateOrUpdateAs * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of an account resource. + * @return the {@link PollerFlux} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AccountInner> beginCreateOrUpdateAsync(String resourceGroupName, - String name, AccountInner resource, Context context) { + String accountName, AccountInner resource, Context context) { context = this.client.mergeContext(context); Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, name, resource, context); + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, resource, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), AccountInner.class, AccountInner.class, context); } @@ -625,51 +749,52 @@ private PollerFlux, AccountInner> beginCreateOrUpdateAs * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an account resource. + * @return the {@link SyncPoller} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String name, - AccountInner resource) { - return this.beginCreateOrUpdateAsync(resourceGroupName, name, resource).getSyncPoller(); + public SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, AccountInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, resource).getSyncPoller(); } /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of an account resource. + * @return the {@link SyncPoller} for polling of a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, String name, - AccountInner resource, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, name, resource, context).getSyncPoller(); + public SyncPoller, AccountInner> beginCreateOrUpdate(String resourceGroupName, + String accountName, AccountInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, resource, context).getSyncPoller(); } /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource on successful completion of {@link Mono}. + * @return a Playwright service account resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String name, AccountInner resource) { - return beginCreateOrUpdateAsync(resourceGroupName, name, resource).last() + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + AccountInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -677,18 +802,18 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @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 an account resource on successful completion of {@link Mono}. + * @return a Playwright service account resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String name, AccountInner resource, + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, AccountInner resource, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, resource, context).last() + return beginCreateOrUpdateAsync(resourceGroupName, accountName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -696,48 +821,50 @@ private Mono createOrUpdateAsync(String resourceGroupName, String * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner createOrUpdate(String resourceGroupName, String name, AccountInner resource) { - return createOrUpdateAsync(resourceGroupName, name, resource).block(); + public AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner resource) { + return createOrUpdateAsync(resourceGroupName, accountName, resource).block(); } /** * Create a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param resource Resource create parameters. * @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 an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner createOrUpdate(String resourceGroupName, String name, AccountInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, name, resource, context).block(); + public AccountInner createOrUpdate(String resourceGroupName, String accountName, AccountInner resource, + Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, resource, context).block(); } /** * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource along with {@link Response} on successful completion of {@link Mono}. + * @return a Playwright service account resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, AccountUpdate properties) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -751,8 +878,8 @@ private Mono> updateWithResponseAsync(String resourceGrou return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -762,7 +889,7 @@ private Mono> updateWithResponseAsync(String resourceGrou final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, properties, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, accountName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -770,16 +897,17 @@ private Mono> updateWithResponseAsync(String resourceGrou * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @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 an account resource along with {@link Response} on successful completion of {@link Mono}. + * @return a Playwright service account resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String name, + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, AccountUpdate properties, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -793,8 +921,8 @@ private Mono> updateWithResponseAsync(String resourceGrou return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } if (properties == null) { return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); @@ -804,23 +932,23 @@ private Mono> updateWithResponseAsync(String resourceGrou final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, name, properties, accept, context); + resourceGroupName, accountName, properties, accept, context); } /** * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource on successful completion of {@link Mono}. + * @return a Playwright service account resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String name, AccountUpdate properties) { - return updateWithResponseAsync(resourceGroupName, name, properties) + private Mono updateAsync(String resourceGroupName, String accountName, AccountUpdate properties) { + return updateWithResponseAsync(resourceGroupName, accountName, properties) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } @@ -828,48 +956,48 @@ private Mono updateAsync(String resourceGroupName, String name, Ac * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @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 an account resource along with {@link Response}. + * @return a Playwright service account resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String name, AccountUpdate properties, - Context context) { - return updateWithResponseAsync(resourceGroupName, name, properties, context).block(); + public Response updateWithResponse(String resourceGroupName, String accountName, + AccountUpdate properties, Context context) { + return updateWithResponseAsync(resourceGroupName, accountName, properties, context).block(); } /** * Update a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param properties The resource properties to be updated. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an account resource. + * @return a Playwright service account resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public AccountInner update(String resourceGroupName, String name, AccountUpdate properties) { - return updateWithResponse(resourceGroupName, name, properties, Context.NONE).getValue(); + public AccountInner update(String resourceGroupName, String accountName, AccountUpdate properties) { + return updateWithResponse(resourceGroupName, accountName, properties, Context.NONE).getValue(); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -882,13 +1010,13 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, name, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -896,7 +1024,7 @@ private Mono>> deleteWithResponseAsync(String resource * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -904,7 +1032,7 @@ private Mono>> deleteWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String name, + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -918,28 +1046,28 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, name, accept, context); + resourceGroupName, accountName, accept, context); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -948,7 +1076,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -956,10 +1084,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name, + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } @@ -968,22 +1096,22 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { - return this.beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName) { + return this.beginDeleteAsync(resourceGroupName, accountName).getSyncPoller(); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -991,30 +1119,31 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { - return this.beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller(); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String name) { - return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String accountName) { + return beginDeleteAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. @@ -1022,45 +1151,44 @@ private Mono deleteAsync(String resourceGroupName, String name) { * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String name, Context context) { - return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteAsync(String resourceGroupName, String accountName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name) { - deleteAsync(resourceGroupName, name).block(); + public void delete(String resourceGroupName, String accountName) { + deleteAsync(resourceGroupName, accountName).block(); } /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String name, Context context) { - deleteAsync(resourceGroupName, name, context).block(); + public void delete(String resourceGroupName, String accountName, Context context) { + deleteAsync(resourceGroupName, accountName, context).block(); } /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1088,9 +1216,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. @@ -1117,9 +1243,7 @@ private Mono> listBySubscriptionNextSinglePageAsync( /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1147,9 +1271,7 @@ private Mono> listByResourceGroupNextSinglePageAsync /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsImpl.java index 76952ced61864..635c3062a1b72 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsImpl.java @@ -11,8 +11,11 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.playwrighttesting.fluent.AccountsClient; import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; +import com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner; import com.azure.resourcemanager.playwrighttesting.models.Account; import com.azure.resourcemanager.playwrighttesting.models.Accounts; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityRequest; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityResponse; public final class AccountsImpl implements Accounts { private static final ClientLogger LOGGER = new ClientLogger(AccountsImpl.class); @@ -37,6 +40,27 @@ public PagedIterable list(Context context) { return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); } + public Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, + Context context) { + Response inner + = this.serviceClient().checkNameAvailabilityWithResponse(body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CheckNameAvailabilityResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body) { + CheckNameAvailabilityResponseInner inner = this.serviceClient().checkNameAvailability(body); + if (inner != null) { + return new CheckNameAvailabilityResponseImpl(inner, this.manager()); + } else { + return null; + } + } + public PagedIterable listByResourceGroup(String resourceGroupName) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); @@ -47,9 +71,10 @@ public PagedIterable listByResourceGroup(String resourceGroupName, Cont return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { Response inner - = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AccountImpl(inner.getValue(), this.manager())); @@ -58,8 +83,8 @@ public Response getByResourceGroupWithResponse(String resourceGroupName } } - public Account getByResourceGroup(String resourceGroupName, String name) { - AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + public Account getByResourceGroup(String resourceGroupName, String accountName) { + AccountInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, accountName); if (inner != null) { return new AccountImpl(inner, this.manager()); } else { @@ -67,12 +92,12 @@ public Account getByResourceGroup(String resourceGroupName, String name) { } } - public void deleteByResourceGroup(String resourceGroupName, String name) { - this.serviceClient().delete(resourceGroupName, name); + public void deleteByResourceGroup(String resourceGroupName, String accountName) { + this.serviceClient().delete(resourceGroupName, accountName); } - public void delete(String resourceGroupName, String name, Context context) { - this.serviceClient().delete(resourceGroupName, name, context); + public void delete(String resourceGroupName, String accountName, Context context) { + this.serviceClient().delete(resourceGroupName, accountName, context); } public Account getById(String id) { @@ -81,12 +106,12 @@ public Account getById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (name == null) { + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE).getValue(); + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); } public Response getByIdWithResponse(String id, Context context) { @@ -95,12 +120,12 @@ public Response getByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (name == null) { + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - return this.getByResourceGroupWithResponse(resourceGroupName, name, context); + return this.getByResourceGroupWithResponse(resourceGroupName, accountName, context); } public void deleteById(String id) { @@ -109,12 +134,12 @@ public void deleteById(String id) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (name == null) { + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - this.delete(resourceGroupName, name, Context.NONE); + this.delete(resourceGroupName, accountName, Context.NONE); } public void deleteByIdWithResponse(String id, Context context) { @@ -123,12 +148,12 @@ public void deleteByIdWithResponse(String id, Context context) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); - if (name == null) { + String accountName = ResourceManagerUtils.getValueFromIdByName(id, "accounts"); + if (accountName == null) { throw LOGGER.logExceptionAsError(new IllegalArgumentException( String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); } - this.delete(resourceGroupName, name, context); + this.delete(resourceGroupName, accountName, context); } private AccountsClient serviceClient() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/CheckNameAvailabilityResponseImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/CheckNameAvailabilityResponseImpl.java new file mode 100644 index 0000000000000..4537f4c0efba6 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/CheckNameAvailabilityResponseImpl.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.implementation; + +import com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityReason; +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityResponse; + +public final class CheckNameAvailabilityResponseImpl implements CheckNameAvailabilityResponse { + private CheckNameAvailabilityResponseInner innerObject; + + private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; + + CheckNameAvailabilityResponseImpl(CheckNameAvailabilityResponseInner innerObject, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public Boolean nameAvailable() { + return this.innerModel().nameAvailable(); + } + + public CheckNameAvailabilityReason reason() { + return this.innerModel().reason(); + } + + public String message() { + return this.innerModel().message(); + } + + public CheckNameAvailabilityResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsClientImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsClientImpl.java index 4d5381d458290..a254550f2beb0 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsClientImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsClientImpl.java @@ -56,8 +56,8 @@ public final class OperationsClientImpl implements OperationsClient { } /** - * The interface defining all the services for PlaywrightTestingMgmtClientOperations to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for PlaywrightTestingMgmtClientOperations to be used by the proxy service + * to perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "PlaywrightTestingMgm") @@ -183,9 +183,7 @@ public PagedIterable list(Context context) { /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -211,9 +209,7 @@ private Mono> listNextSinglePageAsync(String nextL /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientBuilder.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientBuilder.java index f2b149836e432..632eac64a6fc5 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientBuilder.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { PlaywrightTestingMgmtClientImpl.class }) public final class PlaywrightTestingMgmtClientBuilder { /* - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The ID of the target subscription. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the PlaywrightTestingMgmtClientBuilder. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientImpl.java index eb2c3a9642dde..d08f0f9c0fa9e 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/PlaywrightTestingMgmtClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.playwrighttesting.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -22,6 +23,7 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.playwrighttesting.fluent.AccountQuotasClient; import com.azure.resourcemanager.playwrighttesting.fluent.AccountsClient; import com.azure.resourcemanager.playwrighttesting.fluent.OperationsClient; import com.azure.resourcemanager.playwrighttesting.fluent.PlaywrightTestingMgmtClient; @@ -41,12 +43,12 @@ @ServiceClient(builder = PlaywrightTestingMgmtClientBuilder.class) public final class PlaywrightTestingMgmtClientImpl implements PlaywrightTestingMgmtClient { /** - * The ID of the target subscription. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The ID of the target subscription. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -166,6 +168,20 @@ public QuotasClient getQuotas() { return this.quotas; } + /** + * The AccountQuotasClient object to access its operations. + */ + private final AccountQuotasClient accountQuotas; + + /** + * Gets the AccountQuotasClient object to access its operations. + * + * @return the AccountQuotasClient object. + */ + public AccountQuotasClient getAccountQuotas() { + return this.accountQuotas; + } + /** * Initializes an instance of PlaywrightTestingMgmtClient client. * @@ -173,7 +189,7 @@ public QuotasClient getQuotas() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ PlaywrightTestingMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -183,10 +199,11 @@ public QuotasClient getQuotas() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-10-01-preview"; + this.apiVersion = "2024-12-01"; this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); this.quotas = new QuotasClientImpl(this); + this.accountQuotas = new AccountQuotasClientImpl(this); } /** @@ -291,7 +308,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasClientImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasClientImpl.java index b09588d8ffa71..a326a127ada6b 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasClientImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasClientImpl.java @@ -71,12 +71,12 @@ Mono> listBySubscription(@HostParam("$host") String en @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("name") QuotaNames name, + @PathParam("location") String location, @PathParam("quotaName") QuotaNames quotaName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -214,17 +214,17 @@ public PagedIterable listBySubscription(String location, Context con } /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name along with {@link Response} on successful completion of {@link Mono}. + * @return subscription quota by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, QuotaNames name) { + private Mono> getWithResponseAsync(String location, QuotaNames quotaName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -236,29 +236,29 @@ private Mono> getWithResponseAsync(String location, QuotaNa if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (quotaName == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, name, accept, context)) + this.client.getSubscriptionId(), location, quotaName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name along with {@link Response} on successful completion of {@link Mono}. + * @return subscription quota by name along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, QuotaNames name, Context context) { + private Mono> getWithResponseAsync(String location, QuotaNames quotaName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -270,67 +270,65 @@ private Mono> getWithResponseAsync(String location, QuotaNa if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } - if (name == null) { - return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + if (quotaName == null) { + return Mono.error(new IllegalArgumentException("Parameter quotaName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, name, accept, context); + location, quotaName, accept, context); } /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name on successful completion of {@link Mono}. + * @return subscription quota by name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, QuotaNames name) { - return getWithResponseAsync(location, name).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String location, QuotaNames quotaName) { + return getWithResponseAsync(location, quotaName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name along with {@link Response}. + * @return subscription quota by name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, QuotaNames name, Context context) { - return getWithResponseAsync(location, name, context).block(); + public Response getWithResponse(String location, QuotaNames quotaName, Context context) { + return getWithResponseAsync(location, quotaName, context).block(); } /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name. + * @return subscription quota by name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public QuotaInner get(String location, QuotaNames name) { - return getWithResponse(location, name, Context.NONE).getValue(); + public QuotaInner get(String location, QuotaNames quotaName) { + return getWithResponse(location, quotaName, Context.NONE).getValue(); } /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -358,9 +356,7 @@ private Mono> listBySubscriptionNextSinglePageAsync(St /** * Get the next page of items. * - * @param nextLink The URL to get the next list of items - * - * The nextLink parameter. + * @param nextLink The URL to get the next list of items. * @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. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasImpl.java index 539e276419e61..d58c49b9a2287 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasImpl.java @@ -38,8 +38,8 @@ public PagedIterable listBySubscription(String location, Context context) return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); } - public Response getWithResponse(String location, QuotaNames name, Context context) { - Response inner = this.serviceClient().getWithResponse(location, name, context); + public Response getWithResponse(String location, QuotaNames quotaName, Context context) { + Response inner = this.serviceClient().getWithResponse(location, quotaName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new QuotaImpl(inner.getValue(), this.manager())); @@ -48,8 +48,8 @@ public Response getWithResponse(String location, QuotaNames name, Context } } - public Quota get(String location, QuotaNames name) { - QuotaInner inner = this.serviceClient().get(location, name); + public Quota get(String location, QuotaNames quotaName) { + QuotaInner inner = this.serviceClient().get(location, quotaName); if (inner != null) { return new QuotaImpl(inner, this.manager()); } else { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java index 5c0c52be783e2..7973016373a9b 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Account.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Account.java index e269c9cd99c25..0840ea168eeaf 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Account.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Account.java @@ -239,9 +239,9 @@ interface WithTags { */ interface WithProperties { /** - * Specifies the properties property: The updatable properties of the Account.. + * Specifies the properties property: The resource-specific properties for this resource.. * - * @param properties The updatable properties of the Account. + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ Update withProperties(AccountUpdateProperties properties); diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountFreeTrialProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountFreeTrialProperties.java new file mode 100644 index 0000000000000..8ab1cc4fc91a0 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountFreeTrialProperties.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The Playwright service account quota resource free-trial properties. + */ +@Immutable +public final class AccountFreeTrialProperties implements JsonSerializable { + /* + * The free-trial createdAt utcDateTime. + */ + private OffsetDateTime createdAt; + + /* + * The free-trial expiryAt utcDateTime. + */ + private OffsetDateTime expiryAt; + + /* + * The free-trial allocated limit value eg. allocated free minutes. + */ + private int allocatedValue; + + /* + * The free-trial used value eg. used free minutes. + */ + private int usedValue; + + /* + * The free-trial percentage used. + */ + private float percentageUsed; + + /** + * Creates an instance of AccountFreeTrialProperties class. + */ + public AccountFreeTrialProperties() { + } + + /** + * Get the createdAt property: The free-trial createdAt utcDateTime. + * + * @return the createdAt value. + */ + public OffsetDateTime createdAt() { + return this.createdAt; + } + + /** + * Get the expiryAt property: The free-trial expiryAt utcDateTime. + * + * @return the expiryAt value. + */ + public OffsetDateTime expiryAt() { + return this.expiryAt; + } + + /** + * Get the allocatedValue property: The free-trial allocated limit value eg. allocated free minutes. + * + * @return the allocatedValue value. + */ + public int allocatedValue() { + return this.allocatedValue; + } + + /** + * Get the usedValue property: The free-trial used value eg. used free minutes. + * + * @return the usedValue value. + */ + public int usedValue() { + return this.usedValue; + } + + /** + * Get the percentageUsed property: The free-trial percentage used. + * + * @return the percentageUsed value. + */ + public float percentageUsed() { + return this.percentageUsed; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountFreeTrialProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountFreeTrialProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountFreeTrialProperties. + */ + public static AccountFreeTrialProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountFreeTrialProperties deserializedAccountFreeTrialProperties = new AccountFreeTrialProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("createdAt".equals(fieldName)) { + deserializedAccountFreeTrialProperties.createdAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("expiryAt".equals(fieldName)) { + deserializedAccountFreeTrialProperties.expiryAt = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("allocatedValue".equals(fieldName)) { + deserializedAccountFreeTrialProperties.allocatedValue = reader.getInt(); + } else if ("usedValue".equals(fieldName)) { + deserializedAccountFreeTrialProperties.usedValue = reader.getInt(); + } else if ("percentageUsed".equals(fieldName)) { + deserializedAccountFreeTrialProperties.percentageUsed = reader.getFloat(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountFreeTrialProperties; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountListResult.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountListResult.java index b4920bd0cc389..aa24dc11bfeab 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountListResult.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountListResult.java @@ -6,25 +6,27 @@ import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** * The response of a Account list operation. */ @Fluent -public final class AccountListResult { +public final class AccountListResult implements JsonSerializable { /* * The Account items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public AccountListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AccountListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AccountListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(AccountListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountListResult. + */ + public static AccountListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountListResult deserializedAccountListResult = new AccountListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AccountInner.fromJson(reader1)); + deserializedAccountListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAccountListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountListResult; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java index ed648ad9be339..b3c628880f76f 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java @@ -5,17 +5,20 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Account properties. + * Account resource properties. */ @Fluent -public final class AccountProperties { +public final class AccountProperties implements JsonSerializable { /* * The Playwright testing dashboard URI for the account resource. */ - @JsonProperty(value = "dashboardUri", access = JsonProperty.Access.WRITE_ONLY) private String dashboardUri; /* @@ -23,27 +26,29 @@ public final class AccountProperties { * workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to * browsers in the Azure region in which the workspace was initially created. */ - @JsonProperty(value = "regionalAffinity") private EnablementStatus regionalAffinity; /* * When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of * parallel workers for a test run, significantly minimizing test completion durations. */ - @JsonProperty(value = "scalableExecution") private EnablementStatus scalableExecution; /* * When enabled, this feature allows the workspace to upload and display test results, including artifacts like * traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. */ - @JsonProperty(value = "reporting") private EnablementStatus reporting; + /* + * When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test + * runs. + */ + private EnablementStatus localAuth; + /* * The status of the last operation. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -88,9 +93,9 @@ public AccountProperties withRegionalAffinity(EnablementStatus regionalAffinity) } /** - * Get the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted - * browsers. This can increase the number of parallel workers for a test run, significantly minimizing test - * completion durations. + * Get the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted browsers. + * This can increase the number of parallel workers for a test run, significantly minimizing test completion + * durations. * * @return the scalableExecution value. */ @@ -99,9 +104,9 @@ public EnablementStatus scalableExecution() { } /** - * Set the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted - * browsers. This can increase the number of parallel workers for a test run, significantly minimizing test - * completion durations. + * Set the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted browsers. + * This can increase the number of parallel workers for a test run, significantly minimizing test completion + * durations. * * @param scalableExecution the scalableExecution value to set. * @return the AccountProperties object itself. @@ -113,8 +118,8 @@ public AccountProperties withScalableExecution(EnablementStatus scalableExecutio /** * Get the reporting property: When enabled, this feature allows the workspace to upload and display test results, - * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more - * efficient troubleshooting. + * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient + * troubleshooting. * * @return the reporting value. */ @@ -124,8 +129,8 @@ public EnablementStatus reporting() { /** * Set the reporting property: When enabled, this feature allows the workspace to upload and display test results, - * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more - * efficient troubleshooting. + * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient + * troubleshooting. * * @param reporting the reporting value to set. * @return the AccountProperties object itself. @@ -135,6 +140,28 @@ public AccountProperties withReporting(EnablementStatus reporting) { return this; } + /** + * Get the localAuth property: When enabled, this feature allows the workspace to use local auth(through access key) + * for authentication of test runs. + * + * @return the localAuth value. + */ + public EnablementStatus localAuth() { + return this.localAuth; + } + + /** + * Set the localAuth property: When enabled, this feature allows the workspace to use local auth(through access key) + * for authentication of test runs. + * + * @param localAuth the localAuth value to set. + * @return the AccountProperties object itself. + */ + public AccountProperties withLocalAuth(EnablementStatus localAuth) { + this.localAuth = localAuth; + return this; + } + /** * Get the provisioningState property: The status of the last operation. * @@ -151,4 +178,55 @@ public ProvisioningState provisioningState() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("regionalAffinity", + this.regionalAffinity == null ? null : this.regionalAffinity.toString()); + jsonWriter.writeStringField("scalableExecution", + this.scalableExecution == null ? null : this.scalableExecution.toString()); + jsonWriter.writeStringField("reporting", this.reporting == null ? null : this.reporting.toString()); + jsonWriter.writeStringField("localAuth", this.localAuth == null ? null : this.localAuth.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountProperties. + */ + public static AccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountProperties deserializedAccountProperties = new AccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("dashboardUri".equals(fieldName)) { + deserializedAccountProperties.dashboardUri = reader.getString(); + } else if ("regionalAffinity".equals(fieldName)) { + deserializedAccountProperties.regionalAffinity = EnablementStatus.fromString(reader.getString()); + } else if ("scalableExecution".equals(fieldName)) { + deserializedAccountProperties.scalableExecution = EnablementStatus.fromString(reader.getString()); + } else if ("reporting".equals(fieldName)) { + deserializedAccountProperties.reporting = EnablementStatus.fromString(reader.getString()); + } else if ("localAuth".equals(fieldName)) { + deserializedAccountProperties.localAuth = EnablementStatus.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAccountProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountProperties; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuota.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuota.java new file mode 100644 index 0000000000000..783b9c066a429 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuota.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; + +/** + * An immutable client-side representation of AccountQuota. + */ +public interface AccountQuota { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + AccountQuotaProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner object. + * + * @return the inner object. + */ + AccountQuotaInner innerModel(); +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaListResult.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaListResult.java new file mode 100644 index 0000000000000..ea4dde0253463 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaListResult.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a AccountQuota list operation. + */ +@Fluent +public final class AccountQuotaListResult implements JsonSerializable { + /* + * The AccountQuota items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of AccountQuotaListResult class. + */ + public AccountQuotaListResult() { + } + + /** + * Get the value property: The AccountQuota items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: The AccountQuota items on this page. + * + * @param value the value value to set. + * @return the AccountQuotaListResult object itself. + */ + public AccountQuotaListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the AccountQuotaListResult object itself. + */ + public AccountQuotaListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model AccountQuotaListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountQuotaListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountQuotaListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountQuotaListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AccountQuotaListResult. + */ + public static AccountQuotaListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountQuotaListResult deserializedAccountQuotaListResult = new AccountQuotaListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> AccountQuotaInner.fromJson(reader1)); + deserializedAccountQuotaListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedAccountQuotaListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountQuotaListResult; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaProperties.java new file mode 100644 index 0000000000000..b79df45a157a8 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaProperties.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The Playwright service account quota resource properties. + */ +@Fluent +public final class AccountQuotaProperties implements JsonSerializable { + /* + * The Playwright service account quota resource free-trial properties. + */ + private AccountFreeTrialProperties freeTrial; + + /* + * The status of the last operation. + */ + private ProvisioningState provisioningState; + + /** + * Creates an instance of AccountQuotaProperties class. + */ + public AccountQuotaProperties() { + } + + /** + * Get the freeTrial property: The Playwright service account quota resource free-trial properties. + * + * @return the freeTrial value. + */ + public AccountFreeTrialProperties freeTrial() { + return this.freeTrial; + } + + /** + * Set the freeTrial property: The Playwright service account quota resource free-trial properties. + * + * @param freeTrial the freeTrial value to set. + * @return the AccountQuotaProperties object itself. + */ + public AccountQuotaProperties withFreeTrial(AccountFreeTrialProperties freeTrial) { + this.freeTrial = freeTrial; + return this; + } + + /** + * Get the provisioningState property: The status of the last operation. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (freeTrial() != null) { + freeTrial().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("freeTrial", this.freeTrial); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountQuotaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountQuotaProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountQuotaProperties. + */ + public static AccountQuotaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountQuotaProperties deserializedAccountQuotaProperties = new AccountQuotaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("freeTrial".equals(fieldName)) { + deserializedAccountQuotaProperties.freeTrial = AccountFreeTrialProperties.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedAccountQuotaProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountQuotaProperties; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotas.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotas.java new file mode 100644 index 0000000000000..56d707a45fe6c --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotas.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** + * Resource collection API of AccountQuotas. + */ +public interface AccountQuotas { + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName); + + /** + * List quotas for a given account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @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 of a AccountQuota list operation as paginated response with {@link PagedIterable}. + */ + PagedIterable listByAccount(String resourceGroupName, String accountName, Context context); + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String accountName, QuotaNames quotaName, + Context context); + + /** + * Get quota by name for an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return quota by name for an account. + */ + AccountQuota get(String resourceGroupName, String accountName, QuotaNames quotaName); +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdate.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdate.java index e936d6ee79384..6a8da5dac5bc3 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdate.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdate.java @@ -5,26 +5,26 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; import java.util.Map; /** * The type used for update operations of the Account. */ @Fluent -public final class AccountUpdate { +public final class AccountUpdate implements JsonSerializable { /* * Resource tags. */ - @JsonProperty(value = "tags") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) private Map tags; /* - * The updatable properties of the Account. + * The resource-specific properties for this resource. */ - @JsonProperty(value = "properties") private AccountUpdateProperties properties; /** @@ -54,7 +54,7 @@ public AccountUpdate withTags(Map tags) { } /** - * Get the properties property: The updatable properties of the Account. + * Get the properties property: The resource-specific properties for this resource. * * @return the properties value. */ @@ -63,7 +63,7 @@ public AccountUpdateProperties properties() { } /** - * Set the properties property: The updatable properties of the Account. + * Set the properties property: The resource-specific properties for this resource. * * @param properties the properties value to set. * @return the AccountUpdate object itself. @@ -83,4 +83,44 @@ public void validate() { properties().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountUpdate if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountUpdate. + */ + public static AccountUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountUpdate deserializedAccountUpdate = new AccountUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAccountUpdate.tags = tags; + } else if ("properties".equals(fieldName)) { + deserializedAccountUpdate.properties = AccountUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountUpdate; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java index 72a1753eb22af..8f551f23a8b47 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java @@ -5,35 +5,42 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * The updatable properties of the Account. */ @Fluent -public final class AccountUpdateProperties { +public final class AccountUpdateProperties implements JsonSerializable { /* * This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, * workers connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to * browsers in the Azure region in which the workspace was initially created. */ - @JsonProperty(value = "regionalAffinity") private EnablementStatus regionalAffinity; /* * When enabled, Playwright client workers can connect to cloud-hosted browsers. This can increase the number of * parallel workers for a test run, significantly minimizing test completion durations. */ - @JsonProperty(value = "scalableExecution") private EnablementStatus scalableExecution; /* * When enabled, this feature allows the workspace to upload and display test results, including artifacts like * traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. */ - @JsonProperty(value = "reporting") private EnablementStatus reporting; + /* + * When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test + * runs. + */ + private EnablementStatus localAuth; + /** * Creates an instance of AccountUpdateProperties class. */ @@ -67,9 +74,9 @@ public AccountUpdateProperties withRegionalAffinity(EnablementStatus regionalAff } /** - * Get the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted - * browsers. This can increase the number of parallel workers for a test run, significantly minimizing test - * completion durations. + * Get the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted browsers. + * This can increase the number of parallel workers for a test run, significantly minimizing test completion + * durations. * * @return the scalableExecution value. */ @@ -78,9 +85,9 @@ public EnablementStatus scalableExecution() { } /** - * Set the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted - * browsers. This can increase the number of parallel workers for a test run, significantly minimizing test - * completion durations. + * Set the scalableExecution property: When enabled, Playwright client workers can connect to cloud-hosted browsers. + * This can increase the number of parallel workers for a test run, significantly minimizing test completion + * durations. * * @param scalableExecution the scalableExecution value to set. * @return the AccountUpdateProperties object itself. @@ -92,8 +99,8 @@ public AccountUpdateProperties withScalableExecution(EnablementStatus scalableEx /** * Get the reporting property: When enabled, this feature allows the workspace to upload and display test results, - * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more - * efficient troubleshooting. + * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient + * troubleshooting. * * @return the reporting value. */ @@ -103,8 +110,8 @@ public EnablementStatus reporting() { /** * Set the reporting property: When enabled, this feature allows the workspace to upload and display test results, - * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more - * efficient troubleshooting. + * including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient + * troubleshooting. * * @param reporting the reporting value to set. * @return the AccountUpdateProperties object itself. @@ -114,6 +121,28 @@ public AccountUpdateProperties withReporting(EnablementStatus reporting) { return this; } + /** + * Get the localAuth property: When enabled, this feature allows the workspace to use local auth(through access key) + * for authentication of test runs. + * + * @return the localAuth value. + */ + public EnablementStatus localAuth() { + return this.localAuth; + } + + /** + * Set the localAuth property: When enabled, this feature allows the workspace to use local auth(through access key) + * for authentication of test runs. + * + * @param localAuth the localAuth value to set. + * @return the AccountUpdateProperties object itself. + */ + public AccountUpdateProperties withLocalAuth(EnablementStatus localAuth) { + this.localAuth = localAuth; + return this; + } + /** * Validates the instance. * @@ -121,4 +150,53 @@ public AccountUpdateProperties withReporting(EnablementStatus reporting) { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("regionalAffinity", + this.regionalAffinity == null ? null : this.regionalAffinity.toString()); + jsonWriter.writeStringField("scalableExecution", + this.scalableExecution == null ? null : this.scalableExecution.toString()); + jsonWriter.writeStringField("reporting", this.reporting == null ? null : this.reporting.toString()); + jsonWriter.writeStringField("localAuth", this.localAuth == null ? null : this.localAuth.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccountUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccountUpdateProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccountUpdateProperties. + */ + public static AccountUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccountUpdateProperties deserializedAccountUpdateProperties = new AccountUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("regionalAffinity".equals(fieldName)) { + deserializedAccountUpdateProperties.regionalAffinity + = EnablementStatus.fromString(reader.getString()); + } else if ("scalableExecution".equals(fieldName)) { + deserializedAccountUpdateProperties.scalableExecution + = EnablementStatus.fromString(reader.getString()); + } else if ("reporting".equals(fieldName)) { + deserializedAccountUpdateProperties.reporting = EnablementStatus.fromString(reader.getString()); + } else if ("localAuth".equals(fieldName)) { + deserializedAccountUpdateProperties.localAuth = EnablementStatus.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedAccountUpdateProperties; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Accounts.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Accounts.java index 51b0885f11512..7e9a41dd49a65 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Accounts.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Accounts.java @@ -32,6 +32,30 @@ public interface Accounts { */ PagedIterable list(Context context); + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @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 check availability result along with {@link Response}. + */ + Response checkNameAvailabilityWithResponse(CheckNameAvailabilityRequest body, + Context context); + + /** + * Adds check global name availability operation, normally used if a resource name must be globally unique. + * + * @param body The CheckAvailability request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 check availability result. + */ + CheckNameAvailabilityResponse checkNameAvailability(CheckNameAvailabilityRequest body); + /** * List Account resources by resource group. * @@ -59,49 +83,49 @@ public interface Accounts { * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Account along with {@link Response}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, Context context); /** * Get a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Account. */ - Account getByResourceGroup(String resourceGroupName, String name); + Account getByResourceGroup(String resourceGroupName, String accountName); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ - void deleteByResourceGroup(String resourceGroupName, String name); + void deleteByResourceGroup(String resourceGroupName, String accountName); /** * Delete a Account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account. + * @param accountName Name of account. * @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. */ - void delete(String resourceGroupName, String name, Context context); + void delete(String resourceGroupName, String accountName, Context context); /** * Get a Account. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ActionType.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ActionType.java index 10f36fc20dd27..30dcefee1539d 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ActionType.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ActionType.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -32,7 +31,6 @@ public ActionType() { * @param name a name to look for. * @return the corresponding ActionType. */ - @JsonCreator public static ActionType fromString(String name) { return fromString(name, ActionType.class); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityReason.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityReason.java new file mode 100644 index 0000000000000..0cd1b49aa9b44 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityReason.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The reason why the given name is not available. + */ +public final class CheckNameAvailabilityReason extends ExpandableStringEnum { + /** + * Static value Invalid for CheckNameAvailabilityReason. + */ + public static final CheckNameAvailabilityReason INVALID = fromString("Invalid"); + + /** + * Static value AlreadyExists for CheckNameAvailabilityReason. + */ + public static final CheckNameAvailabilityReason ALREADY_EXISTS = fromString("AlreadyExists"); + + /** + * Creates a new instance of CheckNameAvailabilityReason value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CheckNameAvailabilityReason() { + } + + /** + * Creates or finds a CheckNameAvailabilityReason from its string representation. + * + * @param name a name to look for. + * @return the corresponding CheckNameAvailabilityReason. + */ + public static CheckNameAvailabilityReason fromString(String name) { + return fromString(name, CheckNameAvailabilityReason.class); + } + + /** + * Gets known CheckNameAvailabilityReason values. + * + * @return known CheckNameAvailabilityReason values. + */ + public static Collection values() { + return values(CheckNameAvailabilityReason.class); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityRequest.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityRequest.java new file mode 100644 index 0000000000000..f1abfb1ee406f --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityRequest.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The check availability request body. + */ +@Fluent +public final class CheckNameAvailabilityRequest implements JsonSerializable { + /* + * The name of the resource for which availability needs to be checked. + */ + private String name; + + /* + * The resource type. + */ + private String type; + + /** + * Creates an instance of CheckNameAvailabilityRequest class. + */ + public CheckNameAvailabilityRequest() { + } + + /** + * Get the name property: The name of the resource for which availability needs to be checked. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The name of the resource for which availability needs to be checked. + * + * @param name the name value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The resource type. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The resource type. + * + * @param type the type value to set. + * @return the CheckNameAvailabilityRequest object itself. + */ + public CheckNameAvailabilityRequest withType(String type) { + this.type = type; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("type", this.type); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CheckNameAvailabilityRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CheckNameAvailabilityRequest if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CheckNameAvailabilityRequest. + */ + public static CheckNameAvailabilityRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CheckNameAvailabilityRequest deserializedCheckNameAvailabilityRequest = new CheckNameAvailabilityRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCheckNameAvailabilityRequest.type = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCheckNameAvailabilityRequest; + }); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityResponse.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityResponse.java new file mode 100644 index 0000000000000..c157383870c93 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityResponse.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner; + +/** + * An immutable client-side representation of CheckNameAvailabilityResponse. + */ +public interface CheckNameAvailabilityResponse { + /** + * Gets the nameAvailable property: Indicates if the resource name is available. + * + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * Gets the reason property: The reason why the given name is not available. + * + * @return the reason value. + */ + CheckNameAvailabilityReason reason(); + + /** + * Gets the message property: Detailed reason why the given name is available. + * + * @return the message value. + */ + String message(); + + /** + * Gets the inner com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner + * object. + * + * @return the inner object. + */ + CheckNameAvailabilityResponseInner innerModel(); +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/EnablementStatus.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/EnablementStatus.java index 5d227df731400..c0b7ac568f226 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/EnablementStatus.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/EnablementStatus.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** - * The enablement status of a feature. + * This property sets the connection region for Playwright client workers to cloud-hosted browsers. If enabled, workers + * connect to browsers in the closest Azure region, ensuring lower latency. If disabled, workers connect to browsers in + * the Azure region in which the workspace was initially created. */ public final class EnablementStatus extends ExpandableStringEnum { /** @@ -37,7 +38,6 @@ public EnablementStatus() { * @param name a name to look for. * @return the corresponding EnablementStatus. */ - @JsonCreator public static EnablementStatus fromString(String name) { return fromString(name, EnablementStatus.class); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialProperties.java index c87c4b805e9dd..d54fafbb88e09 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialProperties.java @@ -5,55 +5,25 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; -import java.time.OffsetDateTime; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * The free-trial properties. + * The subscription quota resource free-trial properties. */ @Immutable -public final class FreeTrialProperties { +public final class FreeTrialProperties implements JsonSerializable { /* - * The playwright account id. + * The Playwright service account id. */ - @JsonProperty(value = "accountId", required = true, access = JsonProperty.Access.WRITE_ONLY) private String accountId; - /* - * The free-trial createdAt utcDateTime. - */ - @JsonProperty(value = "createdAt", required = true, access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdAt; - - /* - * The free-trial expiryAt utcDateTime. - */ - @JsonProperty(value = "expiryAt", required = true, access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime expiryAt; - - /* - * The free-trial allocated limit value eg. allocated free minutes. - */ - @JsonProperty(value = "allocatedValue", required = true, access = JsonProperty.Access.WRITE_ONLY) - private int allocatedValue; - - /* - * The free-trial used value eg. used free minutes. - */ - @JsonProperty(value = "usedValue", required = true, access = JsonProperty.Access.WRITE_ONLY) - private int usedValue; - - /* - * The free-trial percentage used. - */ - @JsonProperty(value = "percentageUsed", required = true, access = JsonProperty.Access.WRITE_ONLY) - private BigDecimal percentageUsed; - /* * The free-trial state. */ - @JsonProperty(value = "state", required = true, access = JsonProperty.Access.WRITE_ONLY) private FreeTrialState state; /** @@ -63,7 +33,7 @@ public FreeTrialProperties() { } /** - * Get the accountId property: The playwright account id. + * Get the accountId property: The Playwright service account id. * * @return the accountId value. */ @@ -72,64 +42,57 @@ public String accountId() { } /** - * Get the createdAt property: The free-trial createdAt utcDateTime. - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Get the expiryAt property: The free-trial expiryAt utcDateTime. - * - * @return the expiryAt value. - */ - public OffsetDateTime expiryAt() { - return this.expiryAt; - } - - /** - * Get the allocatedValue property: The free-trial allocated limit value eg. allocated free minutes. - * - * @return the allocatedValue value. - */ - public int allocatedValue() { - return this.allocatedValue; - } - - /** - * Get the usedValue property: The free-trial used value eg. used free minutes. + * Get the state property: The free-trial state. * - * @return the usedValue value. + * @return the state value. */ - public int usedValue() { - return this.usedValue; + public FreeTrialState state() { + return this.state; } /** - * Get the percentageUsed property: The free-trial percentage used. + * Validates the instance. * - * @return the percentageUsed value. + * @throws IllegalArgumentException thrown if the instance is not valid. */ - public BigDecimal percentageUsed() { - return this.percentageUsed; + public void validate() { } /** - * Get the state property: The free-trial state. - * - * @return the state value. + * {@inheritDoc} */ - public FreeTrialState state() { - return this.state; + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); } /** - * Validates the instance. + * Reads an instance of FreeTrialProperties from the JsonReader. * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { + * @param jsonReader The JsonReader being read. + * @return An instance of FreeTrialProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FreeTrialProperties. + */ + public static FreeTrialProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FreeTrialProperties deserializedFreeTrialProperties = new FreeTrialProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("accountId".equals(fieldName)) { + deserializedFreeTrialProperties.accountId = reader.getString(); + } else if ("state".equals(fieldName)) { + deserializedFreeTrialProperties.state = FreeTrialState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedFreeTrialProperties; + }); } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialState.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialState.java index 249e2ea70713d..59f3be3164af3 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialState.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/FreeTrialState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -22,6 +21,16 @@ public final class FreeTrialState extends ExpandableStringEnum { */ public static final FreeTrialState EXPIRED = fromString("Expired"); + /** + * Static value NotEligible for FreeTrialState. + */ + public static final FreeTrialState NOT_ELIGIBLE = fromString("NotEligible"); + + /** + * Static value NotRegistered for FreeTrialState. + */ + public static final FreeTrialState NOT_REGISTERED = fromString("NotRegistered"); + /** * Creates a new instance of FreeTrialState value. * @@ -37,7 +46,6 @@ public FreeTrialState() { * @param name a name to look for. * @return the corresponding FreeTrialState. */ - @JsonCreator public static FreeTrialState fromString(String name) { return fromString(name, FreeTrialState.class); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OfferingType.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OfferingType.java new file mode 100644 index 0000000000000..b3fb6e6c68f11 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OfferingType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Offering type state. + */ +public final class OfferingType extends ExpandableStringEnum { + /** + * Static value NotApplicable for OfferingType. + */ + public static final OfferingType NOT_APPLICABLE = fromString("NotApplicable"); + + /** + * Static value PrivatePreview for OfferingType. + */ + public static final OfferingType PRIVATE_PREVIEW = fromString("PrivatePreview"); + + /** + * Static value PublicPreview for OfferingType. + */ + public static final OfferingType PUBLIC_PREVIEW = fromString("PublicPreview"); + + /** + * Static value GeneralAvailability for OfferingType. + */ + public static final OfferingType GENERAL_AVAILABILITY = fromString("GeneralAvailability"); + + /** + * Creates a new instance of OfferingType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public OfferingType() { + } + + /** + * Creates or finds a OfferingType from its string representation. + * + * @param name a name to look for. + * @return the corresponding OfferingType. + */ + public static OfferingType fromString(String name) { + return fromString(name, OfferingType.class); + } + + /** + * Gets known OfferingType values. + * + * @return known OfferingType values. + */ + public static Collection values() { + return values(OfferingType.class); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationDisplay.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationDisplay.java index ff327e196afd9..d19ead2f49d64 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationDisplay.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationDisplay.java @@ -5,38 +5,38 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** * Localized display information for this particular operation. */ @Immutable -public final class OperationDisplay { +public final class OperationDisplay implements JsonSerializable { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or + * "Microsoft Compute". */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or + * "Job Schedule Collections". */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. + * "Create or Update Virtual Machine", "Restart Virtual Machine". */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; /* * The short, localized friendly description of the operation; suitable for tool tips and detailed views. */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; /** @@ -92,4 +92,45 @@ public String description() { */ public void validate() { } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationDisplay from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationDisplay if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationDisplay. + */ + public static OperationDisplay fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationDisplay deserializedOperationDisplay = new OperationDisplay(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provider".equals(fieldName)) { + deserializedOperationDisplay.provider = reader.getString(); + } else if ("resource".equals(fieldName)) { + deserializedOperationDisplay.resource = reader.getString(); + } else if ("operation".equals(fieldName)) { + deserializedOperationDisplay.operation = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedOperationDisplay.description = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationDisplay; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationListResult.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationListResult.java index 7de4d0ad99c8e..66e1bdd524911 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationListResult.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/OperationListResult.java @@ -5,26 +5,28 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; import com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.io.IOException; import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable -public final class OperationListResult { +public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the resource provider */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* * URL to get the next set of operation list results (if there are any). */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; /** @@ -61,4 +63,42 @@ public void validate() { value().forEach(e -> e.validate()); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the OperationListResult. + */ + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Origin.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Origin.java index e32f0e51a0e18..d3016c7461af9 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Origin.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Origin.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -43,7 +42,6 @@ public Origin() { * @param name a name to look for. * @return the corresponding Origin. */ - @JsonCreator public static Origin fromString(String name) { return fromString(name, Origin.class); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ProvisioningState.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ProvisioningState.java index 9a2e66718a4d6..34a3c0ba603d0 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ProvisioningState.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/ProvisioningState.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -27,6 +26,11 @@ public final class ProvisioningState extends ExpandableStringEnum { /* * The Quota items on this page */ - @JsonProperty(value = "value", required = true) private List value; /* * The link to the next page of items */ - @JsonProperty(value = "nextLink") private String nextLink; /** @@ -80,12 +82,53 @@ public QuotaListResult withNextLink(String nextLink) { */ public void validate() { if (value() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property value in model QuotaListResult")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model QuotaListResult")); } else { value().forEach(e -> e.validate()); } } private static final ClientLogger LOGGER = new ClientLogger(QuotaListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaListResult if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the QuotaListResult. + */ + public static QuotaListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaListResult deserializedQuotaListResult = new QuotaListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> QuotaInner.fromJson(reader1)); + deserializedQuotaListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedQuotaListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaListResult; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaNames.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaNames.java index cf80ec67e484b..9726daaff1497 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaNames.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaNames.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; /** @@ -17,6 +16,11 @@ public final class QuotaNames extends ExpandableStringEnum { */ public static final QuotaNames SCALABLE_EXECUTION = fromString("ScalableExecution"); + /** + * Static value Reporting for QuotaNames. + */ + public static final QuotaNames REPORTING = fromString("Reporting"); + /** * Creates a new instance of QuotaNames value. * @@ -32,7 +36,6 @@ public QuotaNames() { * @param name a name to look for. * @return the corresponding QuotaNames. */ - @JsonCreator public static QuotaNames fromString(String name) { return fromString(name, QuotaNames.class); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java index 592902b48f277..aac47c2930427 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java @@ -5,23 +5,30 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; /** - * Quota properties. + * The subscription quota resource properties. */ @Fluent -public final class QuotaProperties { +public final class QuotaProperties implements JsonSerializable { /* - * The free-trial quota. + * The subscription quota resource free-trial properties. */ - @JsonProperty(value = "freeTrial") private FreeTrialProperties freeTrial; + /* + * Indicates the offering type for the subscription. + */ + private OfferingType offeringType; + /* * The status of the last operation. */ - @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; /** @@ -31,7 +38,7 @@ public QuotaProperties() { } /** - * Get the freeTrial property: The free-trial quota. + * Get the freeTrial property: The subscription quota resource free-trial properties. * * @return the freeTrial value. */ @@ -40,7 +47,7 @@ public FreeTrialProperties freeTrial() { } /** - * Set the freeTrial property: The free-trial quota. + * Set the freeTrial property: The subscription quota resource free-trial properties. * * @param freeTrial the freeTrial value to set. * @return the QuotaProperties object itself. @@ -50,6 +57,15 @@ public QuotaProperties withFreeTrial(FreeTrialProperties freeTrial) { return this; } + /** + * Get the offeringType property: Indicates the offering type for the subscription. + * + * @return the offeringType value. + */ + public OfferingType offeringType() { + return this.offeringType; + } + /** * Get the provisioningState property: The status of the last operation. * @@ -69,4 +85,44 @@ public void validate() { freeTrial().validate(); } } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("freeTrial", this.freeTrial); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of QuotaProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of QuotaProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the QuotaProperties. + */ + public static QuotaProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + QuotaProperties deserializedQuotaProperties = new QuotaProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("freeTrial".equals(fieldName)) { + deserializedQuotaProperties.freeTrial = FreeTrialProperties.fromJson(reader); + } else if ("offeringType".equals(fieldName)) { + deserializedQuotaProperties.offeringType = OfferingType.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedQuotaProperties.provisioningState = ProvisioningState.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedQuotaProperties; + }); + } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quotas.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quotas.java index 781e1f8fc4e89..e63189de4da51 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quotas.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quotas.java @@ -36,27 +36,27 @@ public interface Quotas { PagedIterable listBySubscription(String location, Context context); /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name along with {@link Response}. + * @return subscription quota by name along with {@link Response}. */ - Response getWithResponse(String location, QuotaNames name, Context context); + Response getWithResponse(String location, QuotaNames quotaName, Context context); /** - * Get quota by name. + * Get subscription quota by name. * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return quota by name. + * @return subscription quota by name. */ - Quota get(String location, QuotaNames name); + Quota get(String location, QuotaNames quotaName); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/module-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/module-info.java index c74a62f2bf394..671b12392df59 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/module-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/module-info.java @@ -10,6 +10,6 @@ exports com.azure.resourcemanager.playwrighttesting.fluent.models; exports com.azure.resourcemanager.playwrighttesting.models; - opens com.azure.resourcemanager.playwrighttesting.fluent.models to com.azure.core, com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.playwrighttesting.models to com.azure.core, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.playwrighttesting.fluent.models to com.azure.core; + opens com.azure.resourcemanager.playwrighttesting.models to com.azure.core; } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/proxy-config.json b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/proxy-config.json index e551591ebf892..052441fb29a59 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/proxy-config.json +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/proxy-config.json @@ -1 +1 @@ -[ [ "com.azure.resourcemanager.playwrighttesting.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.playwrighttesting.implementation.AccountsClientImpl$AccountsService" ], [ "com.azure.resourcemanager.playwrighttesting.implementation.QuotasClientImpl$QuotasService" ] ] \ No newline at end of file +[["com.azure.resourcemanager.playwrighttesting.implementation.AccountQuotasClientImpl$AccountQuotasService"],["com.azure.resourcemanager.playwrighttesting.implementation.AccountsClientImpl$AccountsService"],["com.azure.resourcemanager.playwrighttesting.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.playwrighttesting.implementation.QuotasClientImpl$QuotasService"]] \ No newline at end of file diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/reflect-config.json b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/reflect-config.json index d57108049f531..0637a088a01e8 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/reflect-config.json +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/reflect-config.json @@ -1,91 +1 @@ -[ { - "name" : "com.azure.resourcemanager.playwrighttesting.models.OperationListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.OperationDisplay", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.QuotaListResult", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.QuotaProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountUpdate", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.Origin", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.ActionType", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.EnablementStatus", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.ProvisioningState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.FreeTrialState", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -}, { - "name" : "com.azure.resourcemanager.playwrighttesting.models.QuotaNames", - "allDeclaredConstructors" : true, - "allDeclaredFields" : true, - "allDeclaredMethods" : true -} ] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasGetSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasGetSamples.java new file mode 100644 index 0000000000000..a77bc198f35d5 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasGetSamples.java @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.generated; + +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; + +/** + * Samples for AccountQuotas Get. + */ +public final class AccountQuotasGetSamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * AccountQuotas_Get.json + */ + /** + * Sample code: AccountQuotas_Get. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void accountQuotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accountQuotas() + .getWithResponse("dummyrg", "myPlaywrightAccount", QuotaNames.SCALABLE_EXECUTION, + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasListByAccountSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasListByAccountSamples.java new file mode 100644 index 0000000000000..2c4064c6d5374 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasListByAccountSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.generated; + +/** + * Samples for AccountQuotas ListByAccount. + */ +public final class AccountQuotasListByAccountSamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * AccountQuotas_ListByAccount.json + */ + /** + * Sample code: AccountQuotas_ListByAccount. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void + accountQuotasListByAccount(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accountQuotas().listByAccount("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCheckNameAvailabilitySamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCheckNameAvailabilitySamples.java new file mode 100644 index 0000000000000..23501312ed109 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCheckNameAvailabilitySamples.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.generated; + +import com.azure.resourcemanager.playwrighttesting.models.CheckNameAvailabilityRequest; + +/** + * Samples for Accounts CheckNameAvailability. + */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_CheckNameAvailability.json + */ + /** + * Sample code: Accounts_CheckNameAvailability. + * + * @param manager Entry point to PlaywrightTestingManager. + */ + public static void + accountsCheckNameAvailability(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accounts() + .checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("dummyName") + .withType("Microsoft.AzurePlaywrightService/Accounts"), com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateSamples.java index 0195e9a3ad297..f052341d57390 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class AccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_CreateOrUpdate.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_CreateOrUpdate.json */ /** * Sample code: Accounts_CreateOrUpdate. @@ -25,9 +25,13 @@ public final class AccountsCreateOrUpdateSamples { */ public static void accountsCreateOrUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.accounts().define("myPlaywrightAccount").withRegion("westus").withExistingResourceGroup("dummyrg") + manager.accounts() + .define("myPlaywrightAccount") + .withRegion("westus") + .withExistingResourceGroup("dummyrg") .withTags(mapOf("Team", "Dev Exp")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)).create(); + .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .create(); } // Use "Map.of" if available diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteSamples.java index 755bc4d7a79dc..4bcadefc160e6 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteSamples.java @@ -10,8 +10,8 @@ public final class AccountsDeleteSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Delete.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Delete.json */ /** * Sample code: Accounts_Delete. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupSamples.java index b3b9f9325d29f..4863aa407e20e 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class AccountsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Get.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Get.json */ /** * Sample code: Accounts_Get. @@ -19,7 +19,7 @@ public final class AccountsGetByResourceGroupSamples { * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.accounts().getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", - com.azure.core.util.Context.NONE); + manager.accounts() + .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupSamples.java index 663e6da521c9a..6c339c8062576 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class AccountsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_ListByResourceGroup.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_ListByResourceGroup.json */ /** * Sample code: Accounts_ListByResourceGroup. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListSamples.java index f54e6e86e77fe..e567bbd57e6eb 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListSamples.java @@ -10,8 +10,8 @@ public final class AccountsListSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_ListBySubscription.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_ListBySubscription.json */ /** * Sample code: Accounts_ListBySubscription. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsUpdateSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsUpdateSamples.java index edd0bfc23a481..10f8058f88024 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsUpdateSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsUpdateSamples.java @@ -16,8 +16,8 @@ public final class AccountsUpdateSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Accounts_Update.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Accounts_Update.json */ /** * Sample code: Accounts_Update. @@ -28,8 +28,10 @@ public static void accountsUpdate(com.azure.resourcemanager.playwrighttesting.Pl Account resource = manager.accounts() .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE) .getValue(); - resource.update().withTags(mapOf("Division", "LT", "Team", "Dev Exp")) - .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)).apply(); + resource.update() + .withTags(mapOf("Division", "LT", "Team", "Dev Exp")) + .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .apply(); } // Use "Map.of" if available diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListSamples.java index ab3767df80aa3..c858bcfb0f82e 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Operations_List.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Operations_List.json */ /** * Sample code: Operations_List. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetSamples.java index ae046da395ab4..7fefa21beea03 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetSamples.java @@ -12,8 +12,8 @@ public final class QuotasGetSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Quotas_Get.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Quotas_Get.json */ /** * Sample code: Quotas_Get. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionSamples.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionSamples.java index 87a1d19e6d0b2..bf5e100e69eb8 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionSamples.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionSamples.java @@ -10,8 +10,8 @@ public final class QuotasListBySubscriptionSamples { /* * x-ms-original-file: - * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/ - * examples/Quotas_ListBySubscription.json + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/ + * Quotas_ListBySubscription.json */ /** * Sample code: Quotas_ListBySubscription. diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountInnerTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountInnerTests.java deleted file mode 100644 index 7f1c9f6454bba..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountInnerTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; -import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccountInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountInner model = BinaryData.fromString( - "{\"properties\":{\"dashboardUri\":\"s\",\"regionalAffinity\":\"Disabled\",\"scalableExecution\":\"Enabled\",\"reporting\":\"Enabled\",\"provisioningState\":\"Canceled\"},\"location\":\"htnapczwlokjyem\",\"tags\":{\"joxzjnchgejspodm\":\"ni\",\"h\":\"ilzyd\"},\"id\":\"jwyahuxinpmqnja\",\"name\":\"wixjsprozvcp\",\"type\":\"tegjvwmf\"}") - .toObject(AccountInner.class); - Assertions.assertEquals("htnapczwlokjyem", model.location()); - Assertions.assertEquals("ni", model.tags().get("joxzjnchgejspodm")); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.properties().reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountInner model = new AccountInner().withLocation("htnapczwlokjyem") - .withTags(mapOf("joxzjnchgejspodm", "ni", "h", "ilzyd")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.DISABLED) - .withScalableExecution(EnablementStatus.ENABLED) - .withReporting(EnablementStatus.ENABLED)); - model = BinaryData.fromObject(model).toObject(AccountInner.class); - Assertions.assertEquals("htnapczwlokjyem", model.location()); - Assertions.assertEquals("ni", model.tags().get("joxzjnchgejspodm")); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.properties().reporting()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountListResultTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountListResultTests.java deleted file mode 100644 index 3e7f2b17ee290..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountListResultTests.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; -import com.azure.resourcemanager.playwrighttesting.models.AccountListResult; -import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccountListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dashboardUri\":\"ithxqhabifpi\",\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Enabled\",\"reporting\":\"Enabled\",\"provisioningState\":\"Failed\"},\"location\":\"pqxu\",\"tags\":{\"n\":\"y\"},\"id\":\"wby\",\"name\":\"rkxvdum\",\"type\":\"grtfwvu\"}],\"nextLink\":\"gaudcc\"}") - .toObject(AccountListResult.class); - Assertions.assertEquals("pqxu", model.value().get(0).location()); - Assertions.assertEquals("y", model.value().get(0).tags().get("n")); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().reporting()); - Assertions.assertEquals("gaudcc", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountListResult model - = new AccountListResult().withValue(Arrays.asList(new AccountInner().withLocation("pqxu") - .withTags(mapOf("n", "y")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED) - .withScalableExecution(EnablementStatus.ENABLED) - .withReporting(EnablementStatus.ENABLED)))) - .withNextLink("gaudcc"); - model = BinaryData.fromObject(model).toObject(AccountListResult.class); - Assertions.assertEquals("pqxu", model.value().get(0).location()); - Assertions.assertEquals("y", model.value().get(0).tags().get("n")); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).properties().reporting()); - Assertions.assertEquals("gaudcc", model.nextLink()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountPropertiesTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountPropertiesTests.java deleted file mode 100644 index 7bf5d71177907..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountPropertiesTests.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import org.junit.jupiter.api.Assertions; - -public final class AccountPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountProperties model = BinaryData.fromString( - "{\"dashboardUri\":\"t\",\"regionalAffinity\":\"Disabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Disabled\",\"provisioningState\":\"Failed\"}") - .toObject(AccountProperties.class); - Assertions.assertEquals(EnablementStatus.DISABLED, model.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountProperties model = new AccountProperties().withRegionalAffinity(EnablementStatus.DISABLED) - .withScalableExecution(EnablementStatus.DISABLED) - .withReporting(EnablementStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(AccountProperties.class); - Assertions.assertEquals(EnablementStatus.DISABLED, model.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.reporting()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdatePropertiesTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdatePropertiesTests.java deleted file mode 100644 index f3b85972dbf1c..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdatePropertiesTests.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import org.junit.jupiter.api.Assertions; - -public final class AccountUpdatePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountUpdateProperties model = BinaryData - .fromString( - "{\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Disabled\"}") - .toObject(AccountUpdateProperties.class); - Assertions.assertEquals(EnablementStatus.ENABLED, model.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountUpdateProperties model = new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED) - .withScalableExecution(EnablementStatus.DISABLED) - .withReporting(EnablementStatus.DISABLED); - model = BinaryData.fromObject(model).toObject(AccountUpdateProperties.class); - Assertions.assertEquals(EnablementStatus.ENABLED, model.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.reporting()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdateTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdateTests.java deleted file mode 100644 index b26158eabd093..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdateTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.AccountUpdate; -import com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class AccountUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AccountUpdate model = BinaryData.fromString( - "{\"tags\":{\"wrwclxxwrljd\":\"ntnbybkzg\",\"kwt\":\"uskcqvkocrcj\",\"ssainqpjwnzll\":\"hxbnjbiksqrg\"},\"properties\":{\"regionalAffinity\":\"Disabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Disabled\"}}") - .toObject(AccountUpdate.class); - Assertions.assertEquals("ntnbybkzg", model.tags().get("wrwclxxwrljd")); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountUpdate model = new AccountUpdate() - .withTags(mapOf("wrwclxxwrljd", "ntnbybkzg", "kwt", "uskcqvkocrcj", "ssainqpjwnzll", "hxbnjbiksqrg")) - .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.DISABLED) - .withScalableExecution(EnablementStatus.DISABLED) - .withReporting(EnablementStatus.DISABLED)); - model = BinaryData.fromObject(model).toObject(AccountUpdate.class); - Assertions.assertEquals("ntnbybkzg", model.tags().get("wrwclxxwrljd")); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.properties().reporting()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateMockTests.java deleted file mode 100644 index f96012f4b605d..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Account; -import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"dashboardUri\":\"bdxkqpxokaj\",\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Enabled\",\"provisioningState\":\"Succeeded\"},\"location\":\"txgcpodgmaajr\",\"tags\":{\"vmclw\":\"jwzrl\",\"aqsqsycbkbfk\":\"ijcoejctb\"},\"id\":\"ukdkexxppofmxa\",\"name\":\"c\",\"type\":\"jpgd\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Account response = manager.accounts() - .define("bznorcjxvsnby") - .withRegion("fblj") - .withExistingResourceGroup("gr") - .withTags(mapOf("qajzyulpkudjkr", "btoqcjmkljavbqid", "e", "khbzhfepgzg", "scpai", "zloc")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.DISABLED) - .withScalableExecution(EnablementStatus.DISABLED) - .withReporting(EnablementStatus.ENABLED)) - .create(); - - Assertions.assertEquals("txgcpodgmaajr", response.location()); - Assertions.assertEquals("jwzrl", response.tags().get("vmclw")); - Assertions.assertEquals(EnablementStatus.ENABLED, response.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.properties().reporting()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteMockTests.java deleted file mode 100644 index 830fba2b7bca7..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteMockTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsDeleteMockTests { - @Test - public void testDelete() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.accounts().delete("dqxhcrmnohjtckwh", "soifiyipjxsqw", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupWithResponseMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 56c0b9b0e0329..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Account; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"dashboardUri\":\"zxufiz\",\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Enabled\",\"reporting\":\"Enabled\",\"provisioningState\":\"Failed\"},\"location\":\"dfvzwdzuhty\",\"tags\":{\"hwxmnteiwa\":\"sdkf\",\"fsrpymzidnse\":\"pvkmijcmmxdcuf\",\"yc\":\"cxtbzsg\",\"mdwzjeiachboo\":\"sne\"},\"id\":\"flnrosfqpteehzz\",\"name\":\"ypyqrimzinp\",\"type\":\"swjdkirso\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Account response = manager.accounts() - .getByResourceGroupWithResponse("uouq", "prwzwbnguitnwui", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("dfvzwdzuhty", response.location()); - Assertions.assertEquals("sdkf", response.tags().get("hwxmnteiwa")); - Assertions.assertEquals(EnablementStatus.ENABLED, response.properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.properties().reporting()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupMockTests.java deleted file mode 100644 index e0498d005cb99..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Account; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"dashboardUri\":\"bciqfouflm\",\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Enabled\",\"provisioningState\":\"Canceled\"},\"location\":\"lougpbkw\",\"tags\":{\"umkdosvqwhbmd\":\"tduqktapspwgcuer\",\"bhtqqrolfpfpsa\":\"bbjfddgmbmbexp\",\"jgzjaoyfhrtx\":\"gbquxigj\",\"fqawrlyxw\":\"lnerkujysvleju\"},\"id\":\"kcprbnw\",\"name\":\"xgjvtbv\",\"type\":\"ysszdnrujqguh\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.accounts().listByResourceGroup("qsrxybzqqed", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("lougpbkw", response.iterator().next().location()); - Assertions.assertEquals("tduqktapspwgcuer", response.iterator().next().tags().get("umkdosvqwhbmd")); - Assertions.assertEquals(EnablementStatus.ENABLED, response.iterator().next().properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.iterator().next().properties().reporting()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListMockTests.java deleted file mode 100644 index 0b672fe100132..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListMockTests.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Account; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class AccountsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"dashboardUri\":\"qxhocdgeablgphut\",\"regionalAffinity\":\"Enabled\",\"scalableExecution\":\"Disabled\",\"reporting\":\"Disabled\",\"provisioningState\":\"Succeeded\"},\"location\":\"yiftyhxhuro\",\"tags\":{\"cukjf\":\"yxolniwp\",\"lryplwckbasyy\":\"giawx\",\"jkot\":\"nddhsgcbacph\"},\"id\":\"nqgoulzndli\",\"name\":\"wyqkgfgibm\",\"type\":\"dgak\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.accounts().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("yiftyhxhuro", response.iterator().next().location()); - Assertions.assertEquals("yxolniwp", response.iterator().next().tags().get("cukjf")); - Assertions.assertEquals(EnablementStatus.ENABLED, response.iterator().next().properties().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().properties().scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().properties().reporting()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/FreeTrialPropertiesTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/FreeTrialPropertiesTests.java deleted file mode 100644 index 858219631eaa5..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/FreeTrialPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; - -public final class FreeTrialPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - FreeTrialProperties model = BinaryData.fromString( - "{\"accountId\":\"qjbasvms\",\"createdAt\":\"2021-01-21T06:57:24Z\",\"expiryAt\":\"2021-08-09T10:57:51Z\",\"allocatedValue\":2070892597,\"usedValue\":2084272233,\"state\":\"Expired\"}") - .toObject(FreeTrialProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - FreeTrialProperties model = new FreeTrialProperties(); - model = BinaryData.fromObject(model).toObject(FreeTrialProperties.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationDisplayTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationDisplayTests.java deleted file mode 100644 index 631de0c3cd7ef..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationInnerTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationInnerTests.java deleted file mode 100644 index 9d29ff34092ae..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner; -import com.azure.resourcemanager.playwrighttesting.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationListResultTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationListResultTests.java deleted file mode 100644 index 8c3aabe7bdbb4..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListMockTests.java deleted file mode 100644 index 5878d4a298cb6..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"name\":\"kyqduujit\",\"isDataAction\":false,\"display\":{\"provider\":\"zevndhkrwpdappds\",\"resource\":\"kvwrwjfeu\",\"operation\":\"hutje\",\"description\":\"mrldhu\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaInnerTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaInnerTests.java deleted file mode 100644 index 6eee652368325..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; - -public final class QuotaInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaInner model = BinaryData.fromString( - "{\"properties\":{\"freeTrial\":{\"accountId\":\"uvamiheognarxzxt\",\"createdAt\":\"2021-08-08T21:36:05Z\",\"expiryAt\":\"2021-07-28T01:15:26Z\",\"allocatedValue\":1638968400,\"usedValue\":1544576839,\"state\":\"Active\"},\"provisioningState\":\"Canceled\"},\"id\":\"evcciqihnhun\",\"name\":\"bwjzr\",\"type\":\"fygxgispemvtzfk\"}") - .toObject(QuotaInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaInner model - = new QuotaInner().withProperties(new QuotaProperties().withFreeTrial(new FreeTrialProperties())); - model = BinaryData.fromObject(model).toObject(QuotaInner.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaListResultTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaListResultTests.java deleted file mode 100644 index 546e12c309e04..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaListResultTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.QuotaListResult; -import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuotaListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"freeTrial\":{\"accountId\":\"uvm\",\"createdAt\":\"2021-07-02T09:33:18Z\",\"expiryAt\":\"2021-08-30T14:27:09Z\",\"allocatedValue\":1523765181,\"usedValue\":37430274,\"state\":\"Active\"},\"provisioningState\":\"Succeeded\"},\"id\":\"dio\",\"name\":\"jpslwejd\",\"type\":\"vwryoqpso\"},{\"properties\":{\"freeTrial\":{\"accountId\":\"tazak\",\"createdAt\":\"2020-12-25T20:04:21Z\",\"expiryAt\":\"2021-11-13T06:20:15Z\",\"allocatedValue\":1063449943,\"usedValue\":1628568580,\"state\":\"Expired\"},\"provisioningState\":\"Deleting\"},\"id\":\"ffdfdosygexpa\",\"name\":\"jakhmsbzjh\",\"type\":\"rzevdphlxaol\"},{\"properties\":{\"freeTrial\":{\"accountId\":\"trg\",\"createdAt\":\"2021-10-25T01:14:42Z\",\"expiryAt\":\"2020-12-22T15:41:37Z\",\"allocatedValue\":1007211846,\"usedValue\":139321967,\"state\":\"Expired\"},\"provisioningState\":\"Accepted\"},\"id\":\"n\",\"name\":\"gvfcj\",\"type\":\"wzo\"},{\"properties\":{\"freeTrial\":{\"accountId\":\"tfell\",\"createdAt\":\"2021-11-29T23:11Z\",\"expiryAt\":\"2021-05-19T06:23:52Z\",\"allocatedValue\":1541264855,\"usedValue\":348508366,\"state\":\"Active\"},\"provisioningState\":\"Accepted\"},\"id\":\"eqfpj\",\"name\":\"jlxofpdvhpfxxyp\",\"type\":\"ninmayhuyb\"}],\"nextLink\":\"podepoo\"}") - .toObject(QuotaListResult.class); - Assertions.assertEquals("podepoo", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaListResult model = new QuotaListResult() - .withValue(Arrays.asList( - new QuotaInner().withProperties(new QuotaProperties().withFreeTrial(new FreeTrialProperties())), - new QuotaInner().withProperties(new QuotaProperties().withFreeTrial(new FreeTrialProperties())), - new QuotaInner().withProperties(new QuotaProperties().withFreeTrial(new FreeTrialProperties())), - new QuotaInner().withProperties(new QuotaProperties().withFreeTrial(new FreeTrialProperties())))) - .withNextLink("podepoo"); - model = BinaryData.fromObject(model).toObject(QuotaListResult.class); - Assertions.assertEquals("podepoo", model.nextLink()); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaPropertiesTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaPropertiesTests.java deleted file mode 100644 index bb8278eac342a..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaPropertiesTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; - -public final class QuotaPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuotaProperties model = BinaryData.fromString( - "{\"freeTrial\":{\"accountId\":\"ubljofxqe\",\"createdAt\":\"2021-05-14T22:11:20Z\",\"expiryAt\":\"2021-02-25T06:04:33Z\",\"allocatedValue\":1330720242,\"usedValue\":56034680,\"state\":\"Active\"},\"provisioningState\":\"Canceled\"}") - .toObject(QuotaProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuotaProperties model = new QuotaProperties().withFreeTrial(new FreeTrialProperties()); - model = BinaryData.fromObject(model).toObject(QuotaProperties.class); - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetWithResponseMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetWithResponseMockTests.java deleted file mode 100644 index f7ce7b387714e..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetWithResponseMockTests.java +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Quota; -import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"properties\":{\"freeTrial\":{\"accountId\":\"dglmjthjqkwp\",\"createdAt\":\"2021-11-24T17:43:24Z\",\"expiryAt\":\"2021-11-30T09:09:34Z\",\"allocatedValue\":1516038621,\"usedValue\":1222275240,\"state\":\"Active\"},\"provisioningState\":\"Failed\"},\"id\":\"wqvhkhixuigdt\",\"name\":\"pbobjo\",\"type\":\"hm\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Quota response = manager.quotas() - .getWithResponse("btwnpzaoqvuhrhcf", QuotaNames.SCALABLE_EXECUTION, com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionMockTests.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionMockTests.java deleted file mode 100644 index 797066aac980f..0000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.playwrighttesting.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager; -import com.azure.resourcemanager.playwrighttesting.models.Quota; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class QuotasListBySubscriptionMockTests { - @Test - public void testListBySubscription() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"freeTrial\":{\"accountId\":\"hvpmoue\",\"createdAt\":\"2021-09-12T01:29:13Z\",\"expiryAt\":\"2021-06-30T20:07:19Z\",\"allocatedValue\":2146697807,\"usedValue\":9507758,\"state\":\"Active\"},\"provisioningState\":\"Deleting\"},\"id\":\"ojnxqbzvdd\",\"name\":\"t\",\"type\":\"ndei\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - PlaywrightTestingManager manager = PlaywrightTestingManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.quotas().listBySubscription("toc", com.azure.core.util.Context.NONE); - - } -}