diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md index 1e4cec15007d..ce837fdb83d1 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.2 (Unreleased) +## 1.0.0-beta.1 (2024-01-30) + +- 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-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md index 81bdfd784fe3..704edb0f94cc 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-02-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-playwrighttesting - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) @@ -45,7 +45,7 @@ Azure Management Libraries require a `TokenCredential` implementation for authen ### Authentication -By default, Azure Active Directory token authentication depends on correct configuration of the following environment variables. +By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables. - `AZURE_CLIENT_ID` for Azure client ID. - `AZURE_TENANT_ID` for Azure tenant ID. @@ -94,7 +94,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS [docs]: https://azure.github.io/azure-sdk-for-java/ -[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ [azure_subscription]: https://azure.microsoft.com/free/ [azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity [azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md index c7088dc5185d..fdf7df1860fe 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,33 +24,97 @@ - [Get](#quotas_get) - [ListBySubscription](#quotas_listbysubscription) +### AccountQuotas_Get + +```java +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; +import java.util.stream.Collectors; + +/** + * Samples for AccountQuotas Get. + */ +public final class AccountQuotasGetSamples { + /* + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-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-02-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-02-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 +import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; -/** Samples for Accounts CreateOrUpdate. */ +/** + * Samples for Accounts CreateOrUpdate. + */ public final class AccountsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_CreateOrUpdate.json */ /** * Sample code: Accounts_CreateOrUpdate. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsCreateOrUpdate( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager - .accounts() - .define("myPlaywrightAccount") - .withRegion("westus") - .withExistingResourceGroup("dummyrg") - .withTags(mapOf("Team", "Dev Exp")) - .withRegionalAffinity(EnablementStatus.ENABLED) - .create(); + public static void accountsCreateOrUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accounts().define("myPlaywrightAccount").withRegion("westus").withExistingResourceGroup("dummyrg").withTags(mapOf("Team", "Dev Exp")).withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)).create(); } // Use "Map.of" if available @@ -64,14 +134,16 @@ public final class AccountsCreateOrUpdateSamples { ### Accounts_Delete ```java -/** Samples for Accounts Delete. */ +/** + * Samples for Accounts Delete. + */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_Delete.json */ /** * Sample code: Accounts_Delete. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsDelete(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { @@ -83,20 +155,20 @@ public final class AccountsDeleteSamples { ### Accounts_GetByResourceGroup ```java -/** Samples for Accounts GetByResourceGroup. */ +/** + * Samples for Accounts GetByResourceGroup. + */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_Get.json */ /** * Sample code: Accounts_Get. - * + * * @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); } } ``` @@ -104,18 +176,19 @@ public final class AccountsGetByResourceGroupSamples { ### Accounts_List ```java -/** Samples for Accounts List. */ +/** + * Samples for Accounts List. + */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_ListBySubscription.json */ /** * Sample code: Accounts_ListBySubscription. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsListBySubscription( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void accountsListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.accounts().list(com.azure.core.util.Context.NONE); } } @@ -124,18 +197,19 @@ public final class AccountsListSamples { ### Accounts_ListByResourceGroup ```java -/** Samples for Accounts ListByResourceGroup. */ +/** + * Samples for Accounts ListByResourceGroup. + */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_ListByResourceGroup.json */ /** * Sample code: Accounts_ListByResourceGroup. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsListByResourceGroup( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void accountsListByResourceGroup(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.accounts().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); } } @@ -145,31 +219,27 @@ public final class AccountsListByResourceGroupSamples { ```java import com.azure.resourcemanager.playwrighttesting.models.Account; +import com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties; import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; import java.util.HashMap; import java.util.Map; +import java.util.stream.Collectors; -/** Samples for Accounts Update. */ +/** + * Samples for Accounts Update. + */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Accounts_Update.json */ /** * Sample code: Accounts_Update. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - Account resource = - manager - .accounts() - .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("Division", "LT", "Team", "Dev Exp")) - .withRegionalAffinity(EnablementStatus.ENABLED) - .apply(); + 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(); } // Use "Map.of" if available @@ -189,14 +259,16 @@ public final class AccountsUpdateSamples { ### Operations_List ```java -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Operations_List.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void operationsList(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { @@ -209,15 +281,18 @@ public final class OperationsListSamples { ```java import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; +import java.util.stream.Collectors; -/** Samples for Quotas Get. */ +/** + * Samples for Quotas Get. + */ public final class QuotasGetSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Quotas_Get.json */ /** * Sample code: Quotas_Get. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void quotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { @@ -229,18 +304,19 @@ public final class QuotasGetSamples { ### Quotas_ListBySubscription ```java -/** Samples for Quotas ListBySubscription. */ +/** + * Samples for Quotas ListBySubscription. + */ public final class QuotasListBySubscriptionSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json + * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/Quotas_ListBySubscription.json */ /** * Sample code: Quotas_ListBySubscription. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void quotasListBySubscription( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void quotasListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.quotas().listBySubscription("eastus", com.azure.core.util.Context.NONE); } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml index cf494e07b39c..b4cfff4589ec 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-02-01. https://github.com/Azure/azure-sdk-for-java @@ -88,8 +88,6 @@ 4.11.0 test - - net.bytebuddy byte-buddy 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 1076ea2e5856..d07e121b1e92 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 @@ -24,10 +24,12 @@ 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; @@ -38,7 +40,10 @@ import java.util.Objects; import java.util.stream.Collectors; -/** Entry point to PlaywrightTestingManager. Azure Playwright testing management service. */ +/** + * Entry point to PlaywrightTestingManager. + * Azure Playwright testing management service. + */ public final class PlaywrightTestingManager { private Operations operations; @@ -46,23 +51,21 @@ public final class PlaywrightTestingManager { private Quotas quotas; + private AccountQuotas accountQuotas; + private final PlaywrightTestingMgmtClient clientObject; private PlaywrightTestingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new PlaywrightTestingMgmtClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); + this.clientObject = new PlaywrightTestingMgmtClientBuilder().pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval).buildClient(); } /** * Creates an instance of Playwright Testing service API entry point. - * + * * @param credential the credential to use. * @param profile the Azure profile for client. * @return the Playwright Testing service API instance. @@ -75,7 +78,7 @@ public static PlaywrightTestingManager authenticate(TokenCredential credential, /** * Creates an instance of Playwright Testing service API entry point. - * + * * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. * @param profile the Azure profile for client. * @return the Playwright Testing service API instance. @@ -88,14 +91,16 @@ public static PlaywrightTestingManager authenticate(HttpPipeline httpPipeline, A /** * Gets a Configurable instance that can be used to create PlaywrightTestingManager with optional configuration. - * + * * @return the Configurable instance allowing configurations. */ public static Configurable configure() { return new PlaywrightTestingManager.Configurable(); } - /** The Configurable allowing configurations to be set. */ + /** + * The Configurable allowing configurations to be set. + */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); @@ -167,8 +172,8 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) { /** * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. + *

+ * This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. * * @param retryOptions the retry options for the HTTP pipeline retry policy. * @return the configurable object itself. @@ -185,8 +190,8 @@ public Configurable withRetryOptions(RetryOptions retryOptions) { * @return the configurable object itself. */ public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); + this.defaultPollInterval + = Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); if (this.defaultPollInterval.isNegative()) { throw LOGGER .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); @@ -206,21 +211,12 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.playwrighttesting") - .append("/") - .append("1.0.0-beta.1"); + userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.playwrighttesting") + .append("/").append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); + userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -239,38 +235,25 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); + HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); return new PlaywrightTestingManager(httpPipeline, profile, defaultPollInterval); } } /** * Gets the resource collection API of Operations. - * + * * @return Resource collection API of Operations. */ public Operations operations() { @@ -282,7 +265,7 @@ public Operations operations() { /** * Gets the resource collection API of Accounts. It manages Account. - * + * * @return Resource collection API of Accounts. */ public Accounts accounts() { @@ -294,7 +277,7 @@ public Accounts accounts() { /** * Gets the resource collection API of Quotas. - * + * * @return Resource collection API of Quotas. */ public Quotas quotas() { @@ -304,10 +287,22 @@ 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. - * + * * @return Wrapped service client PlaywrightTestingMgmtClient. */ public PlaywrightTestingMgmtClient serviceClient() { 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 000000000000..cadd3ebe2d8f --- /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 974bb24bc8f1..9023000f7f92 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,13 +12,17 @@ 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. */ +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ public interface AccountsClient { /** * List Account resources by subscription ID. - * + * * @throws com.azure.core.management.exception.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 Account list operation as paginated response with {@link PagedIterable}. @@ -28,7 +32,7 @@ public interface AccountsClient { /** * List Account resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -38,9 +42,35 @@ 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. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -52,7 +82,7 @@ public interface AccountsClient { /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -65,9 +95,9 @@ 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. @@ -75,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, AccountInner resource); + 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, AccountInner resource, Context context); + 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, Context context); + 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. @@ -205,30 +236,30 @@ Response updateWithResponse( * @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/OperationsClient.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/OperationsClient.java index dd9aef72b527..1b8161a72e5c 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/OperationsClient.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/OperationsClient.java @@ -10,28 +10,30 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public interface OperationsClient { /** * List the operations for the provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(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 30b4e00f643d..b7bcc570fda9 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 @@ -7,61 +7,70 @@ import com.azure.core.http.HttpPipeline; import java.time.Duration; -/** The interface for PlaywrightTestingMgmtClient class. */ +/** + * The interface for PlaywrightTestingMgmtClient class. + */ 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. */ String getSubscriptionId(); /** * Gets server parameter. - * + * * @return the endpoint value. */ String getEndpoint(); /** * Gets Api Version. - * + * * @return the apiVersion value. */ String getApiVersion(); /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ HttpPipeline getHttpPipeline(); /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ Duration getDefaultPollInterval(); /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ OperationsClient getOperations(); /** * Gets the AccountsClient object to access its operations. - * + * * @return the AccountsClient object. */ AccountsClient getAccounts(); /** * Gets the QuotasClient object to access its operations. - * + * * @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 2106958352a1..16096a0d3639 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 @@ -12,11 +12,13 @@ import com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner; import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; -/** An instance of this class provides access to all the operations defined in QuotasClient. */ +/** + * An instance of this class provides access to all the operations defined in QuotasClient. + */ public interface QuotasClient { /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -28,7 +30,7 @@ public interface QuotasClient { /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -40,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 8a366fcb16b2..3f9c5f74743e 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,19 +7,20 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; +import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; import com.fasterxml.jackson.annotation.JsonProperty; 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 innerProperties; + private AccountProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -27,151 +28,67 @@ public final class AccountInner extends Resource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of AccountInner class. */ - public AccountInner() { - } - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. + * Creates an instance of AccountInner class. */ - private AccountProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** {@inheritDoc} */ - @Override - public AccountInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public AccountInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the dashboardUri property: The Playwright testing dashboard URI for the account resource. - * - * @return the dashboardUri value. - */ - public String dashboardUri() { - return this.innerProperties() == null ? null : this.innerProperties().dashboardUri(); + public AccountInner() { } /** - * Get the regionalAffinity property: 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. - * - * @return the regionalAffinity value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public EnablementStatus regionalAffinity() { - return this.innerProperties() == null ? null : this.innerProperties().regionalAffinity(); + public AccountProperties properties() { + return this.properties; } /** - * Set the regionalAffinity property: 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. - * - * @param regionalAffinity the regionalAffinity value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the AccountInner object itself. */ - public AccountInner withRegionalAffinity(EnablementStatus regionalAffinity) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountProperties(); - } - this.innerProperties().withRegionalAffinity(regionalAffinity); + public AccountInner withProperties(AccountProperties properties) { + this.properties = properties; return this; } /** - * 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. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public EnablementStatus scalableExecution() { - return this.innerProperties() == null ? null : this.innerProperties().scalableExecution(); + public SystemData systemData() { + return this.systemData; } /** - * 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 AccountInner object itself. + * {@inheritDoc} */ - public AccountInner withScalableExecution(EnablementStatus scalableExecution) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountProperties(); - } - this.innerProperties().withScalableExecution(scalableExecution); + @Override + public AccountInner withLocation(String location) { + super.withLocation(location); return this; } /** - * 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. - * - * @return the reporting value. + * {@inheritDoc} */ - public EnablementStatus reporting() { - return this.innerProperties() == null ? null : this.innerProperties().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. - * - * @param reporting the reporting value to set. - * @return the AccountInner object itself. - */ - public AccountInner withReporting(EnablementStatus reporting) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountProperties(); - } - this.innerProperties().withReporting(reporting); + @Override + public AccountInner withTags(Map tags) { + super.withTags(tags); return this; } - /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); - } - /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } 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 000000000000..994fb8a4b8b7 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountQuotaInner.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.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.playwrighttesting.models.AccountQuotaProperties; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A quota resource for a Playwright service account. + */ +@Fluent +public final class AccountQuotaInner extends ProxyResource { + /* + * The resource-specific properties for this resource. + */ + @JsonProperty(value = "properties") + private AccountQuotaProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} 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 000000000000..ff1c81f32f1b --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/CheckNameAvailabilityResponseInner.java @@ -0,0 +1,107 @@ +// 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.resourcemanager.playwrighttesting.models.CheckNameAvailabilityReason; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The check availability result. + */ +@Fluent +public final class CheckNameAvailabilityResponseInner { + /* + * Indicates if the resource name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /* + * The reason why the given name is not available. + */ + @JsonProperty(value = "reason") + private CheckNameAvailabilityReason reason; + + /* + * Detailed reason why the given name is available. + */ + @JsonProperty(value = "message") + 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() { + } +} 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 69e5228328e0..dd534be1537d 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 @@ -12,8 +12,8 @@ /** * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. + * + * Details of a REST API operation, returned from the Resource Provider Operations API. */ @Fluent public final class OperationInner { @@ -50,14 +50,16 @@ public final class OperationInner { @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) private ActionType actionType; - /** Creates an instance of OperationInner class. */ + /** + * Creates an instance of OperationInner class. + */ public OperationInner() { } /** * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ public String name() { @@ -67,7 +69,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ public Boolean isDataAction() { @@ -76,7 +78,7 @@ public Boolean isDataAction() { /** * Get the display property: Localized display information for this particular operation. - * + * * @return the display value. */ public OperationDisplay display() { @@ -85,7 +87,7 @@ public OperationDisplay display() { /** * Set the display property: Localized display information for this particular operation. - * + * * @param display the display value to set. * @return the OperationInner object itself. */ @@ -97,7 +99,7 @@ public OperationInner withDisplay(OperationDisplay display) { /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ public Origin origin() { @@ -107,7 +109,7 @@ public Origin origin() { /** * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ public ActionType actionType() { @@ -116,7 +118,7 @@ public ActionType actionType() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 aaa6da1a529e..9976a4b7216b 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,18 +7,19 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; +import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; import com.fasterxml.jackson.annotation.JsonProperty; -/** 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 innerProperties; + private QuotaProperties properties; /* * Azure Resource Manager metadata containing createdBy and modifiedBy information. @@ -26,68 +27,49 @@ public final class QuotaInner extends ProxyResource { @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) private SystemData systemData; - /** Creates an instance of QuotaInner class. */ - public QuotaInner() { - } - /** - * Get the innerProperties property: The resource-specific properties for this resource. - * - * @return the innerProperties value. - */ - private QuotaProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. + * Creates an instance of QuotaInner class. */ - public SystemData systemData() { - return this.systemData; + public QuotaInner() { } /** - * Get the freeTrial property: The free-trial quota. - * - * @return the freeTrial value. + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - public FreeTrialProperties freeTrial() { - return this.innerProperties() == null ? null : this.innerProperties().freeTrial(); + public QuotaProperties properties() { + return this.properties; } /** - * Set the freeTrial property: The free-trial quota. - * - * @param freeTrial the freeTrial value to set. + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. * @return the QuotaInner object itself. */ - public QuotaInner withFreeTrial(FreeTrialProperties freeTrial) { - if (this.innerProperties() == null) { - this.innerProperties = new QuotaProperties(); - } - this.innerProperties().withFreeTrial(freeTrial); + public QuotaInner withProperties(QuotaProperties properties) { + this.properties = properties; return this; } /** - * Get the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - public ProvisioningState provisioningState() { - return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + public SystemData systemData() { + return this.systemData; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/package-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/package-info.java index 7c5ac5b9fcdc..90e7bd7f0901 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/package-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for PlaywrightTestingMgmtClient. Azure Playwright testing management - * service. + * Package containing the inner data models for PlaywrightTestingMgmtClient. + * Azure Playwright testing management service. */ package com.azure.resourcemanager.playwrighttesting.fluent.models; diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/package-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/package-info.java index 67d0c17047be..22ece0f28fc0 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/package-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/package-info.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for PlaywrightTestingMgmtClient. Azure Playwright testing management service. + * Package containing the service clients for PlaywrightTestingMgmtClient. + * Azure Playwright testing management service. */ package com.azure.resourcemanager.playwrighttesting.fluent; 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 561e22421c52..0dfaa17912c1 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 @@ -9,9 +9,9 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; import com.azure.resourcemanager.playwrighttesting.models.Account; +import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; import com.azure.resourcemanager.playwrighttesting.models.AccountUpdate; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; +import com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties; import java.util.Collections; import java.util.Map; @@ -45,28 +45,12 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String dashboardUri() { - return this.innerModel().dashboardUri(); - } - - public EnablementStatus regionalAffinity() { - return this.innerModel().regionalAffinity(); - } - - public EnablementStatus scalableExecution() { - return this.innerModel().scalableExecution(); + public AccountProperties properties() { + return this.innerModel().properties(); } - public EnablementStatus reporting() { - return this.innerModel().reporting(); - } - - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public Region region() { @@ -91,7 +75,7 @@ private com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager man private String resourceGroupName; - private String name; + private String accountName; private AccountUpdate updateProperties; @@ -101,27 +85,21 @@ public AccountImpl withExistingResourceGroup(String resourceGroupName) { } public Account create() { - this.innerObject = - serviceManager - .serviceClient() - .getAccounts() - .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient().getAccounts().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); + this.innerObject = serviceManager.serviceClient().getAccounts().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() { @@ -130,50 +108,34 @@ public AccountImpl update() { } public Account apply() { - this.innerObject = - serviceManager - .serviceClient() - .getAccounts() - .updateWithResponse(resourceGroupName, name, updateProperties, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateProperties, Context.NONE).getValue(); return this; } public Account apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAccounts() - .updateWithResponse(resourceGroupName, name, updateProperties, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAccounts() + .updateWithResponse(resourceGroupName, accountName, updateProperties, context).getValue(); return this; } - AccountImpl( - AccountInner innerObject, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + AccountImpl(AccountInner innerObject, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.name = Utils.getValueFromIdByName(innerObject.id(), "accounts"); + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.accountName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "accounts"); } public Account refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue(); return this; } public Account refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getAccounts() - .getByResourceGroupWithResponse(resourceGroupName, name, context) - .getValue(); + this.innerObject = serviceManager.serviceClient().getAccounts() + .getByResourceGroupWithResponse(resourceGroupName, accountName, context).getValue(); return this; } @@ -197,34 +159,14 @@ public AccountImpl withTags(Map tags) { } } - public AccountImpl withRegionalAffinity(EnablementStatus regionalAffinity) { - if (isInCreateMode()) { - this.innerModel().withRegionalAffinity(regionalAffinity); - return this; - } else { - this.updateProperties.withRegionalAffinity(regionalAffinity); - return this; - } - } - - public AccountImpl withScalableExecution(EnablementStatus scalableExecution) { - if (isInCreateMode()) { - this.innerModel().withScalableExecution(scalableExecution); - return this; - } else { - this.updateProperties.withScalableExecution(scalableExecution); - return this; - } + public AccountImpl withProperties(AccountProperties properties) { + this.innerModel().withProperties(properties); + return this; } - public AccountImpl withReporting(EnablementStatus reporting) { - if (isInCreateMode()) { - this.innerModel().withReporting(reporting); - return this; - } else { - this.updateProperties.withReporting(reporting); - return this; - } + public AccountImpl withProperties(AccountUpdateProperties properties) { + this.updateProperties.withProperties(properties); + return this; } private boolean isInCreateMode() { 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 000000000000..fc26eb965fcd --- /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 000000000000..7742a50dfd7a --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountQuotasClientImpl.java @@ -0,0 +1,422 @@ +// 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 + * + * The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 + * + * The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response 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 000000000000..abc45b728d42 --- /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 c24449cbc5ec..189937caade4 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,23 +35,31 @@ 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; -/** An instance of this class provides access to all the operations defined in AccountsClient. */ +/** + * An instance of this class provides access to all the operations defined in AccountsClient. + */ public final class AccountsClientImpl implements AccountsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final AccountsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final PlaywrightTestingMgmtClientImpl client; /** * Initializes an instance of AccountsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ AccountsClientImpl(PlaywrightTestingMgmtClientImpl client) { @@ -65,214 +74,159 @@ public final class AccountsClientImpl implements AccountsClient { @Host("{$host}") @ServiceInterface(name = "PlaywrightTestingMgm") public interface AccountsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/accounts") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, - Context context); + 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"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @HeaderParam("Accept") String accept, + 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/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts") + @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, - @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") - @ExpectedResponses({200, 201}) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") + @ExpectedResponses({ 200 }) @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, - @BodyParam("application/json") AccountInner resource, - @HeaderParam("Accept") String accept, - Context context); + Mono> getByResourceGroup(@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"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") + @ExpectedResponses({ 200, 201 }) @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, - @BodyParam("application/json") AccountUpdate properties, - @HeaderParam("Accept") String accept, + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @BodyParam("application/json") AccountInner resource, @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}) + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") + @ExpectedResponses({ 200 }) @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, - @HeaderParam("Accept") String accept, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @BodyParam("application/json") AccountUpdate properties, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}") + @ExpectedResponses({ 200, 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("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List Account resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), 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 Account resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - accept, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Account resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { - return new PagedFlux<>( - () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List Account resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -281,13 +235,13 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List Account resources by subscription ID. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation as paginated response with {@link PagedIterable}. @@ -299,7 +253,7 @@ public PagedIterable list() { /** * List Account resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -311,29 +265,133 @@ 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. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -341,53 +399,34 @@ private Mono> listByResourceGroupSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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 Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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 Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Context context) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { return Mono @@ -396,27 +435,15 @@ private Mono> listByResourceGroupSinglePageAsync( final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -425,14 +452,13 @@ private Mono> listByResourceGroupSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -442,14 +468,13 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -463,7 +488,7 @@ public PagedIterable listByResourceGroup(String resourceGroupName) /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -478,56 +503,44 @@ 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -535,61 +548,50 @@ 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + 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())); } /** * 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. @@ -597,58 +599,55 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str * @return a Account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String name, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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.")); @@ -657,54 +656,41 @@ private Mono>> createOrUpdateWithResponseAsync( } 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)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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.")); @@ -713,201 +699,187 @@ private Mono>> createOrUpdateWithResponseAsync( } 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); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + 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); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AccountInner.class, AccountInner.class, this.client.getContext()); + private PollerFlux, AccountInner> beginCreateOrUpdateAsync(String resourceGroupName, + 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()); } /** * 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) { + private PollerFlux, AccountInner> beginCreateOrUpdateAsync(String resourceGroupName, + String accountName, AccountInner resource, Context context) { context = this.client.mergeContext(context); - Mono>> mono = - createOrUpdateWithResponseAsync(resourceGroupName, name, resource, context); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), AccountInner.class, AccountInner.class, context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, resource, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + AccountInner.class, AccountInner.class, 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 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); } /** * 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, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, name, resource, context) - .last() + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, AccountInner resource, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * 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, AccountUpdate properties) { + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + AccountUpdate properties) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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.")); @@ -916,54 +888,41 @@ private Mono> updateWithResponseAsync( } 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)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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, AccountUpdate properties, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String accountName, + AccountUpdate properties, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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.")); @@ -972,121 +931,100 @@ private Mono> updateWithResponseAsync( } 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); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + 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())); } /** * 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * 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. @@ -1094,64 +1032,51 @@ 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, Context context) { + private Mono>> deleteWithResponseAsync(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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { 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); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + 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); - return this - .client - .getLroResult( - mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + 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()); } /** * 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. @@ -1159,35 +1084,34 @@ 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, Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); - return this - .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + 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 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. @@ -1195,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. @@ -1226,49 +1151,51 @@ 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. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -1276,38 +1203,30 @@ private Mono> listBySubscriptionNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -1315,36 +1234,27 @@ private Mono> listBySubscriptionNextSinglePageAsync( return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { @@ -1352,38 +1262,30 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Account list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { @@ -1391,23 +1293,13 @@ private Mono> listByResourceGroupNextSinglePageAsync return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listByResourceGroupNext(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/AccountsImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/AccountsImpl.java index 52b534a5b2a2..635c3062a1b7 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); @@ -21,8 +24,7 @@ public final class AccountsImpl implements Accounts { private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; - public AccountsImpl( - AccountsClient innerClient, + public AccountsImpl(AccountsClient innerClient, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -30,40 +32,59 @@ public AccountsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + 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 Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); } public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return Utils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new AccountImpl(inner1, this.manager())); } - public Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName, + Context context) { + Response inner + = this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, accountName, context); if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new AccountImpl(inner.getValue(), this.manager())); } else { return null; } } - 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 { @@ -71,88 +92,68 @@ 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) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = Utils.getValueFromIdByName(id, "accounts"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + 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) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = Utils.getValueFromIdByName(id, "accounts"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + 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) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = Utils.getValueFromIdByName(id, "accounts"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + 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) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); + String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); } - String name = Utils.getValueFromIdByName(id, "accounts"); - if (name == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'accounts'.", id))); + 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 000000000000..4537f4c0efba --- /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/OperationImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationImpl.java index 653ecfc62fc4..057480fbb231 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationImpl.java @@ -15,8 +15,7 @@ public final class OperationImpl implements Operation { private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; - OperationImpl( - OperationInner innerObject, + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerObject = innerObject; this.serviceManager = 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 c4e625ca971d..4d5381d45829 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 @@ -30,125 +30,106 @@ import com.azure.resourcemanager.playwrighttesting.models.OperationListResult; import reactor.core.publisher.Mono; -/** An instance of this class provides access to all the operations defined in OperationsClient. */ +/** + * An instance of this class provides access to all the operations defined in OperationsClient. + */ public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final OperationsService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final PlaywrightTestingMgmtClientImpl client; /** * Initializes an instance of OperationsClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ OperationsClientImpl(PlaywrightTestingMgmtClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.service + = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * 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") public interface OperationsService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.AzurePlaywrightService/operations") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -157,27 +138,27 @@ private PagedFlux listAsync() { /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * List the operations for the provider. - * + * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -186,13 +167,13 @@ public PagedIterable list() { /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -201,14 +182,15 @@ 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. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -216,37 +198,28 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { @@ -254,23 +227,13 @@ private Mono> listNextSinglePageAsync(String nextL return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsImpl.java index bcc01acfc94e..942c576177df 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/OperationsImpl.java @@ -19,8 +19,7 @@ public final class OperationsImpl implements Operations { private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; - public OperationsImpl( - OperationsClient innerClient, + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; @@ -28,12 +27,12 @@ public OperationsImpl( public PagedIterable list() { PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } public PagedIterable list(Context context) { PagedIterable inner = this.serviceClient().list(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/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 2d0f7192f0f5..d1e9878062cd 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 @@ -14,17 +14,19 @@ import com.azure.core.util.serializer.SerializerAdapter; import java.time.Duration; -/** A builder for creating a new instance of the PlaywrightTestingMgmtClientImpl type. */ -@ServiceClientBuilder(serviceClients = {PlaywrightTestingMgmtClientImpl.class}) +/** + * A builder for creating a new instance of the PlaywrightTestingMgmtClientImpl type. + */ +@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. */ @@ -40,7 +42,7 @@ public PlaywrightTestingMgmtClientBuilder subscriptionId(String subscriptionId) /** * Sets server parameter. - * + * * @param endpoint the endpoint value. * @return the PlaywrightTestingMgmtClientBuilder. */ @@ -56,7 +58,7 @@ public PlaywrightTestingMgmtClientBuilder endpoint(String endpoint) { /** * Sets The environment to connect to. - * + * * @param environment the environment value. * @return the PlaywrightTestingMgmtClientBuilder. */ @@ -72,7 +74,7 @@ public PlaywrightTestingMgmtClientBuilder environment(AzureEnvironment environme /** * Sets The HTTP pipeline to send requests through. - * + * * @param pipeline the pipeline value. * @return the PlaywrightTestingMgmtClientBuilder. */ @@ -88,7 +90,7 @@ public PlaywrightTestingMgmtClientBuilder pipeline(HttpPipeline pipeline) { /** * Sets The default poll interval for long-running operation. - * + * * @param defaultPollInterval the defaultPollInterval value. * @return the PlaywrightTestingMgmtClientBuilder. */ @@ -104,7 +106,7 @@ public PlaywrightTestingMgmtClientBuilder defaultPollInterval(Duration defaultPo /** * Sets The serializer to serialize an object into a string. - * + * * @param serializerAdapter the serializerAdapter value. * @return the PlaywrightTestingMgmtClientBuilder. */ @@ -115,30 +117,20 @@ public PlaywrightTestingMgmtClientBuilder serializerAdapter(SerializerAdapter se /** * Builds an instance of PlaywrightTestingMgmtClientImpl with the provided parameters. - * + * * @return an instance of PlaywrightTestingMgmtClientImpl. */ public PlaywrightTestingMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - PlaywrightTestingMgmtClientImpl client = - new PlaywrightTestingMgmtClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - this.subscriptionId, - localEndpoint); + HttpPipeline localPipeline = (pipeline != null) ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + PlaywrightTestingMgmtClientImpl client = new PlaywrightTestingMgmtClientImpl(localPipeline, + localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); return client; } } 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 91eeba04d9cd..e21f86ab61e5 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 @@ -22,6 +22,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; @@ -35,148 +36,178 @@ import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -/** Initializes a new instance of the PlaywrightTestingMgmtClientImpl type. */ +/** + * Initializes a new instance of the PlaywrightTestingMgmtClientImpl type. + */ @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. */ public String getSubscriptionId() { return this.subscriptionId; } - /** server parameter. */ + /** + * server parameter. + */ private final String endpoint; /** * Gets server parameter. - * + * * @return the endpoint value. */ public String getEndpoint() { return this.endpoint; } - /** Api Version. */ + /** + * Api Version. + */ private final String apiVersion; /** * Gets Api Version. - * + * * @return the apiVersion value. */ public String getApiVersion() { return this.apiVersion; } - /** The HTTP pipeline to send requests through. */ + /** + * The HTTP pipeline to send requests through. + */ private final HttpPipeline httpPipeline; /** * Gets The HTTP pipeline to send requests through. - * + * * @return the httpPipeline value. */ public HttpPipeline getHttpPipeline() { return this.httpPipeline; } - /** The serializer to serialize an object into a string. */ + /** + * The serializer to serialize an object into a string. + */ private final SerializerAdapter serializerAdapter; /** * Gets The serializer to serialize an object into a string. - * + * * @return the serializerAdapter value. */ SerializerAdapter getSerializerAdapter() { return this.serializerAdapter; } - /** The default poll interval for long-running operation. */ + /** + * The default poll interval for long-running operation. + */ private final Duration defaultPollInterval; /** * Gets The default poll interval for long-running operation. - * + * * @return the defaultPollInterval value. */ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } - /** The OperationsClient object to access its operations. */ + /** + * The OperationsClient object to access its operations. + */ private final OperationsClient operations; /** * Gets the OperationsClient object to access its operations. - * + * * @return the OperationsClient object. */ public OperationsClient getOperations() { return this.operations; } - /** The AccountsClient object to access its operations. */ + /** + * The AccountsClient object to access its operations. + */ private final AccountsClient accounts; /** * Gets the AccountsClient object to access its operations. - * + * * @return the AccountsClient object. */ public AccountsClient getAccounts() { return this.accounts; } - /** The QuotasClient object to access its operations. */ + /** + * The QuotasClient object to access its operations. + */ private final QuotasClient quotas; /** * Gets the QuotasClient object to access its operations. - * + * * @return the QuotasClient object. */ 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. - * + * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @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, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { + PlaywrightTestingMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2023-10-01-preview"; + this.apiVersion = "2024-02-01"; this.operations = new OperationsClientImpl(this); this.accounts = new AccountsClientImpl(this); this.quotas = new QuotasClientImpl(this); + this.accountQuotas = new AccountQuotasClientImpl(this); } /** * Gets default client context. - * + * * @return the default client context. */ public Context getContext() { @@ -185,7 +216,7 @@ public Context getContext() { /** * Merges default client context with provided context. - * + * * @param context the context to be merged with default client context. * @return the merged context. */ @@ -195,7 +226,7 @@ public Context mergeContext(Context context) { /** * Gets long running operation result. - * + * * @param activationResponse the response of activation operation. * @param httpPipeline the http pipeline. * @param pollResultType type of poll result. @@ -205,26 +236,15 @@ public Context mergeContext(Context context) { * @param type of final result. * @return poller flux for poll result and final result. */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); + public PollerFlux, U> getLroResult(Mono>> activationResponse, + HttpPipeline httpPipeline, Type pollResultType, Type finalResultType, Context context) { + return PollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, activationResponse, context); } /** * Gets the final result, or an error, based on last async poll response. - * + * * @param response the last async poll response. * @param type of poll result. * @param type of final result. @@ -237,19 +257,16 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, HttpResponse errorResponse = null; PollResult.Error lroError = response.getValue().getError(); if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + errorResponse = new HttpResponseImpl(lroError.getResponseStatusCode(), lroError.getResponseHeaders(), + lroError.getResponseBody()); errorMessage = response.getValue().getError().getMessage(); String errorBody = response.getValue().getError().getResponseBody(); if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, + SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotaImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotaImpl.java index 5be6cb19aa9a..2bba90979d89 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotaImpl.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotaImpl.java @@ -6,17 +6,16 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; import com.azure.resourcemanager.playwrighttesting.models.Quota; +import com.azure.resourcemanager.playwrighttesting.models.QuotaProperties; public final class QuotaImpl implements Quota { private QuotaInner innerObject; private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; - QuotaImpl( - QuotaInner innerObject, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + QuotaImpl(QuotaInner innerObject, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -33,16 +32,12 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public FreeTrialProperties freeTrial() { - return this.innerModel().freeTrial(); + public QuotaProperties properties() { + return this.innerModel().properties(); } - public ProvisioningState provisioningState() { - return this.innerModel().provisioningState(); + public SystemData systemData() { + return this.innerModel().systemData(); } public QuotaInner innerModel() { 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 8c27a2ad5ddc..5d5dbba5baf2 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 @@ -31,17 +31,23 @@ 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 QuotasClient. */ +/** + * An instance of this class provides access to all the operations defined in QuotasClient. + */ public final class QuotasClientImpl implements QuotasClient { - /** The proxy service used to perform REST calls. */ + /** + * The proxy service used to perform REST calls. + */ private final QuotasService service; - /** The service client containing this operation class. */ + /** + * The service client containing this operation class. + */ private final PlaywrightTestingMgmtClientImpl client; /** * Initializes an instance of QuotasClientImpl. - * + * * @param client the instance of the service client containing this operation class. */ QuotasClientImpl(PlaywrightTestingMgmtClientImpl client) { @@ -56,118 +62,84 @@ public final class QuotasClientImpl implements QuotasClient { @Host("{$host}") @ServiceInterface(name = "PlaywrightTestingMgm") public interface QuotasService { - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listBySubscription( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @HeaderParam("Accept") String accept, - Context context); + Mono> listBySubscription(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @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}") - @ExpectedResponses({200}) + @Headers({ "Content-Type: application/json" }) + @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, - @HeaderParam("Accept") String accept, - Context context); + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("quotaName") QuotaNames quotaName, + @HeaderParam("Accept") String accept, Context context); - @Headers({"Content-Type: application/json"}) + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") - @ExpectedResponses({200}) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 Quota list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionSinglePageAsync(String location) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext( - context -> - service - .listBySubscription( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, 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 subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @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 Quota list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionSinglePageAsync(String location, Context context) { if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (location == null) { return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); @@ -175,27 +147,15 @@ private Mono> listBySubscriptionSinglePageAsync(String final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listBySubscription( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - location, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + .listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -204,14 +164,13 @@ private Mono> listBySubscriptionSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBySubscriptionAsync(String location) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(location), + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(location), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -221,14 +180,13 @@ private PagedFlux listBySubscriptionAsync(String location) { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listBySubscriptionAsync(String location, Context context) { - return new PagedFlux<>( - () -> listBySubscriptionSinglePageAsync(location, context), + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(location, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -242,7 +200,7 @@ public PagedIterable listBySubscription(String location) { /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -256,151 +214,128 @@ 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + 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.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (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); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + 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. + * + * The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Quota list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { @@ -408,38 +343,30 @@ private Mono> listBySubscriptionNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the next page of items. - * + * * @param nextLink The URL to get the next list of items - *

The nextLink parameter. + * + * The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response of a Quota list operation along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, Context context) { @@ -447,23 +374,13 @@ private Mono> listBySubscriptionNextSinglePageAsync(St return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); + return service.listBySubscriptionNext(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/QuotasImpl.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/QuotasImpl.java index 444400b71c92..d58c49b9a228 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 @@ -22,37 +22,34 @@ public final class QuotasImpl implements Quotas { private final com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager; - public QuotasImpl( - QuotasClient innerClient, com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { + public QuotasImpl(QuotasClient innerClient, + com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } public PagedIterable listBySubscription(String location) { PagedIterable inner = this.serviceClient().listBySubscription(location); - return Utils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); + return ResourceManagerUtils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); } public PagedIterable listBySubscription(String location, Context context) { PagedIterable inner = this.serviceClient().listBySubscription(location, context); - return Utils.mapPage(inner, inner1 -> new QuotaImpl(inner1, this.manager())); + 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(), + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new QuotaImpl(inner.getValue(), this.manager())); } else { return null; } } - 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/Utils.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java similarity index 80% rename from sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/Utils.java rename to sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java index e7001f36cc1c..5c0c52be783e 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/Utils.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/ResourceManagerUtils.java @@ -19,7 +19,10 @@ import java.util.stream.Stream; import reactor.core.publisher.Flux; -final class Utils { +final class ResourceManagerUtils { + private ResourceManagerUtils() { + } + static String getValueFromIdByName(String id, String name) { if (id == null) { return null; @@ -38,6 +41,7 @@ static String getValueFromIdByName(String id, String name) { } } return null; + } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -60,7 +64,7 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri segments.add(idSegment); idItrReverted.forEachRemaining(segments::add); Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { + if (!segments.isEmpty() && segments.get(0).isEmpty()) { segments.remove(0); } return String.join("/", segments); @@ -71,10 +75,11 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; + } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); + return new PagedIterableImpl<>(pageIterable, mapper); } private static final class PagedIterableImpl extends PagedIterable { @@ -84,26 +89,17 @@ private static final class PagedIterableImpl extends PagedIterable { private final Function, PagedResponse> pageMapper; private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + super(PagedFlux.create(() -> (continuationToken, pageSize) -> Flux + .fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); this.pagedIterable = pagedIterable; this.mapper = mapper; this.pageMapper = getPageMapper(mapper); } private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + return page -> new PagedResponseBase(page.getRequest(), page.getStatusCode(), page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), page.getContinuationToken(), + null); } @Override @@ -133,30 +129,27 @@ public Stream> streamByPage(String continuationToken, int prefe @Override public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); + return new IteratorImpl<>(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + return new IterableImpl<>(pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } @@ -198,7 +191,7 @@ private IterableImpl(Iterable iterable, Function mapper) { @Override public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); + return new IteratorImpl<>(iterable.iterator(), mapper); } } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/package-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/package-info.java index 97bcd06b23bb..e7c99958cd93 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/package-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/implementation/package-info.java @@ -3,6 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the implementations for PlaywrightTestingMgmtClient. Azure Playwright testing management service. + * Package containing the implementations for PlaywrightTestingMgmtClient. + * Azure Playwright testing management service. */ package com.azure.resourcemanager.playwrighttesting.implementation; 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 4a23b4b67a53..e269c9cd99c2 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 @@ -10,139 +10,111 @@ import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; import java.util.Map; -/** An immutable client-side representation of Account. */ +/** + * An immutable client-side representation of Account. + */ public interface Account { /** * Gets the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ String id(); /** * Gets the name property: The name of the resource. - * + * * @return the name value. */ String name(); /** * Gets the type property: The type of the resource. - * + * * @return the type value. */ String type(); /** * Gets the location property: The geo-location where the resource lives. - * + * * @return the location value. */ String location(); /** * Gets the tags property: Resource tags. - * + * * @return the tags value. */ Map tags(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the dashboardUri property: The Playwright testing dashboard URI for the account resource. - * - * @return the dashboardUri value. - */ - String dashboardUri(); - - /** - * Gets the regionalAffinity property: 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. - * - * @return the regionalAffinity value. - */ - EnablementStatus regionalAffinity(); - - /** - * Gets 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. - */ - EnablementStatus scalableExecution(); - - /** - * Gets 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. - * - * @return the reporting value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - EnablementStatus reporting(); + AccountProperties properties(); /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the region of the resource. - * + * * @return the region of the resource. */ Region region(); /** * Gets the name of the resource region. - * + * * @return the name of the resource region. */ String regionName(); /** * Gets the name of the resource group. - * + * * @return the name of the resource group. */ String resourceGroupName(); /** * Gets the inner com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner object. - * + * * @return the inner object. */ AccountInner innerModel(); - /** The entirety of the Account definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithCreate { + /** + * The entirety of the Account definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { } - /** The Account definition stages. */ + /** + * The Account definition stages. + */ interface DefinitionStages { - /** The first stage of the Account definition. */ + /** + * The first stage of the Account definition. + */ interface Blank extends WithLocation { } - /** The stage of the Account definition allowing to specify location. */ + /** + * The stage of the Account definition allowing to specify location. + */ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ @@ -150,18 +122,20 @@ interface WithLocation { /** * Specifies the region for the resource. - * + * * @param location The geo-location where the resource lives. * @return the next definition stage. */ WithResourceGroup withRegion(String location); } - /** The stage of the Account definition allowing to specify parent resource. */ + /** + * The stage of the Account definition allowing to specify parent resource. + */ interface WithResourceGroup { /** * Specifies resourceGroupName. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ @@ -172,186 +146,118 @@ interface WithResourceGroup { * The stage of the Account definition which contains all the minimum required properties for the resource to be * created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, - DefinitionStages.WithRegionalAffinity, - DefinitionStages.WithScalableExecution, - DefinitionStages.WithReporting { + interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithProperties { /** * Executes the create request. - * + * * @return the created resource. */ Account create(); /** * Executes the create request. - * + * * @param context The context to associate with this operation. * @return the created resource. */ Account create(Context context); } - /** The stage of the Account definition allowing to specify tags. */ + /** + * The stage of the Account definition allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ WithCreate withTags(Map tags); } - /** The stage of the Account definition allowing to specify regionalAffinity. */ - interface WithRegionalAffinity { - /** - * Specifies the regionalAffinity property: 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.. - * - * @param regionalAffinity 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. - * @return the next definition stage. - */ - WithCreate withRegionalAffinity(EnablementStatus regionalAffinity); - } - - /** The stage of the Account definition allowing to specify scalableExecution. */ - interface WithScalableExecution { - /** - * Specifies 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 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 next definition stage. - */ - WithCreate withScalableExecution(EnablementStatus scalableExecution); - } - - /** The stage of the Account definition allowing to specify reporting. */ - interface WithReporting { + /** + * The stage of the Account definition allowing to specify properties. + */ + interface WithProperties { /** - * Specifies 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.. - * - * @param reporting 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. + * Specifies the properties property: The resource-specific properties for this resource.. + * + * @param properties The resource-specific properties for this resource. * @return the next definition stage. */ - WithCreate withReporting(EnablementStatus reporting); + WithCreate withProperties(AccountProperties properties); } } /** * Begins update for the Account resource. - * + * * @return the stage of resource update. */ Account.Update update(); - /** The template for Account update. */ - interface Update - extends UpdateStages.WithTags, - UpdateStages.WithRegionalAffinity, - UpdateStages.WithScalableExecution, - UpdateStages.WithReporting { + /** + * The template for Account update. + */ + interface Update extends UpdateStages.WithTags, UpdateStages.WithProperties { /** * Executes the update request. - * + * * @return the updated resource. */ Account apply(); /** * Executes the update request. - * + * * @param context The context to associate with this operation. * @return the updated resource. */ Account apply(Context context); } - /** The Account update stages. */ + /** + * The Account update stages. + */ interface UpdateStages { - /** The stage of the Account update allowing to specify tags. */ + /** + * The stage of the Account update allowing to specify tags. + */ interface WithTags { /** * Specifies the tags property: Resource tags.. - * + * * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); } - /** The stage of the Account update allowing to specify regionalAffinity. */ - interface WithRegionalAffinity { - /** - * Specifies the regionalAffinity property: 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.. - * - * @param regionalAffinity 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. - * @return the next definition stage. - */ - Update withRegionalAffinity(EnablementStatus regionalAffinity); - } - - /** The stage of the Account update allowing to specify scalableExecution. */ - interface WithScalableExecution { - /** - * Specifies 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 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 next definition stage. - */ - Update withScalableExecution(EnablementStatus scalableExecution); - } - - /** The stage of the Account update allowing to specify reporting. */ - interface WithReporting { + /** + * The stage of the Account update allowing to specify properties. + */ + interface WithProperties { /** - * Specifies 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.. - * - * @param reporting 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. + * Specifies the properties property: The updatable properties of the Account.. + * + * @param properties The updatable properties of the Account. * @return the next definition stage. */ - Update withReporting(EnablementStatus reporting); + Update withProperties(AccountUpdateProperties properties); } } /** * Refreshes the resource to sync with Azure. - * + * * @return the refreshed resource. */ Account refresh(); /** * Refreshes the resource to sync with Azure. - * + * * @param context The context to associate with this operation. * @return the refreshed resource. */ diff --git a/sdk/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 000000000000..512a8ee5a5e8 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountFreeTrialProperties.java @@ -0,0 +1,104 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** + * The Playwright service account quota resource free-trial properties. + */ +@Immutable +public final class AccountFreeTrialProperties { + /* + * 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 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() { + } +} 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 44f89f8ed062..b4920bd0cc38 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 @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Account list operation. */ +/** + * The response of a Account list operation. + */ @Fluent public final class AccountListResult { /* @@ -25,13 +27,15 @@ public final class AccountListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of AccountListResult class. */ + /** + * Creates an instance of AccountListResult class. + */ public AccountListResult() { } /** * Get the value property: The Account items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Account items on this page. - * + * * @param value the value value to set. * @return the AccountListResult object itself. */ @@ -51,7 +55,7 @@ public AccountListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the AccountListResult object itself. */ @@ -71,14 +75,13 @@ public AccountListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model AccountListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AccountListResult")); } else { value().forEach(e -> e.validate()); } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java similarity index 84% rename from sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountProperties.java rename to sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java index 8b6d5d194582..04dbc33f3301 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountProperties.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.playwrighttesting.fluent.models; +package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** Account properties. */ +/** + * Account resource properties. + */ @Fluent public final class AccountProperties { /* @@ -46,13 +46,15 @@ public final class AccountProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of AccountProperties class. */ + /** + * Creates an instance of AccountProperties class. + */ public AccountProperties() { } /** * Get the dashboardUri property: The Playwright testing dashboard URI for the account resource. - * + * * @return the dashboardUri value. */ public String dashboardUri() { @@ -64,7 +66,7 @@ public String dashboardUri() { * 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. - * + * * @return the regionalAffinity value. */ public EnablementStatus regionalAffinity() { @@ -76,7 +78,7 @@ public EnablementStatus regionalAffinity() { * 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. - * + * * @param regionalAffinity the regionalAffinity value to set. * @return the AccountProperties object itself. */ @@ -86,10 +88,10 @@ 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. */ public EnablementStatus scalableExecution() { @@ -97,10 +99,10 @@ 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. */ @@ -111,9 +113,9 @@ 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. */ public EnablementStatus reporting() { @@ -122,9 +124,9 @@ 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,7 +137,7 @@ public AccountProperties withReporting(EnablementStatus reporting) { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -144,7 +146,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 000000000000..783b9c066a42 --- /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 000000000000..9461c1828859 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaListResult.java @@ -0,0 +1,91 @@ +// 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.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * The response of a AccountQuota list operation. + */ +@Fluent +public final class AccountQuotaListResult { + /* + * The AccountQuota 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; + + /** + * 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.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model AccountQuotaListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AccountQuotaListResult.class); +} 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 000000000000..6e5ab105a383 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountQuotaProperties.java @@ -0,0 +1,72 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Playwright service account quota resource properties. + */ +@Fluent +public final class AccountQuotaProperties { + /* + * The Playwright service account quota resource free-trial properties. + */ + @JsonProperty(value = "freeTrial") + private AccountFreeTrialProperties freeTrial; + + /* + * The status of the last operation. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + 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(); + } + } +} 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 000000000000..56d707a45fe6 --- /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 944793c658b1..e936d6ee7938 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,12 +5,13 @@ package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountUpdateProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -/** The type used for update operations of the Account. */ +/** + * The type used for update operations of the Account. + */ @Fluent public final class AccountUpdate { /* @@ -24,15 +25,17 @@ public final class AccountUpdate { * The updatable properties of the Account. */ @JsonProperty(value = "properties") - private AccountUpdateProperties innerProperties; + private AccountUpdateProperties properties; - /** Creates an instance of AccountUpdate class. */ + /** + * Creates an instance of AccountUpdate class. + */ public AccountUpdate() { } /** * Get the tags property: Resource tags. - * + * * @return the tags value. */ public Map tags() { @@ -41,7 +44,7 @@ public Map tags() { /** * Set the tags property: Resource tags. - * + * * @param tags the tags value to set. * @return the AccountUpdate object itself. */ @@ -51,105 +54,33 @@ public AccountUpdate withTags(Map tags) { } /** - * Get the innerProperties property: The updatable properties of the Account. - * - * @return the innerProperties value. - */ - private AccountUpdateProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the regionalAffinity property: 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. - * - * @return the regionalAffinity value. + * Get the properties property: The updatable properties of the Account. + * + * @return the properties value. */ - public EnablementStatus regionalAffinity() { - return this.innerProperties() == null ? null : this.innerProperties().regionalAffinity(); + public AccountUpdateProperties properties() { + return this.properties; } /** - * Set the regionalAffinity property: 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. - * - * @param regionalAffinity the regionalAffinity value to set. + * Set the properties property: The updatable properties of the Account. + * + * @param properties the properties value to set. * @return the AccountUpdate object itself. */ - public AccountUpdate withRegionalAffinity(EnablementStatus regionalAffinity) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountUpdateProperties(); - } - this.innerProperties().withRegionalAffinity(regionalAffinity); - return this; - } - - /** - * 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. - */ - public EnablementStatus scalableExecution() { - return this.innerProperties() == null ? null : this.innerProperties().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. - * - * @param scalableExecution the scalableExecution value to set. - * @return the AccountUpdate object itself. - */ - public AccountUpdate withScalableExecution(EnablementStatus scalableExecution) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountUpdateProperties(); - } - this.innerProperties().withScalableExecution(scalableExecution); - return this; - } - - /** - * 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. - * - * @return the reporting value. - */ - public EnablementStatus reporting() { - return this.innerProperties() == null ? null : this.innerProperties().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. - * - * @param reporting the reporting value to set. - * @return the AccountUpdate object itself. - */ - public AccountUpdate withReporting(EnablementStatus reporting) { - if (this.innerProperties() == null) { - this.innerProperties = new AccountUpdateProperties(); - } - this.innerProperties().withReporting(reporting); + public AccountUpdate withProperties(AccountUpdateProperties properties) { + this.properties = properties; return this; } /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); + if (properties() != null) { + properties().validate(); } } } diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountUpdateProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java similarity index 83% rename from sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountUpdateProperties.java rename to sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java index ba744fd5a4e5..72a1753eb22a 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/AccountUpdateProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/AccountUpdateProperties.java @@ -2,13 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.playwrighttesting.fluent.models; +package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; import com.fasterxml.jackson.annotation.JsonProperty; -/** The updatable properties of the Account. */ +/** + * The updatable properties of the Account. + */ @Fluent public final class AccountUpdateProperties { /* @@ -33,7 +34,9 @@ public final class AccountUpdateProperties { @JsonProperty(value = "reporting") private EnablementStatus reporting; - /** Creates an instance of AccountUpdateProperties class. */ + /** + * Creates an instance of AccountUpdateProperties class. + */ public AccountUpdateProperties() { } @@ -42,7 +45,7 @@ public AccountUpdateProperties() { * 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. - * + * * @return the regionalAffinity value. */ public EnablementStatus regionalAffinity() { @@ -54,7 +57,7 @@ public EnablementStatus regionalAffinity() { * 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. - * + * * @param regionalAffinity the regionalAffinity value to set. * @return the AccountUpdateProperties object itself. */ @@ -64,10 +67,10 @@ 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. */ public EnablementStatus scalableExecution() { @@ -75,10 +78,10 @@ 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. */ @@ -89,9 +92,9 @@ 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. */ public EnablementStatus reporting() { @@ -100,9 +103,9 @@ 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. */ @@ -113,7 +116,7 @@ public AccountUpdateProperties withReporting(EnablementStatus reporting) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 817cbffb33d1..7e9a41dd49a6 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Accounts. */ +/** + * Resource collection API of Accounts. + */ public interface Accounts { /** * List Account resources by subscription ID. - * + * * @throws com.azure.core.management.exception.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 Account list operation as paginated response with {@link PagedIterable}. @@ -21,7 +23,7 @@ public interface Accounts { /** * List Account resources by subscription ID. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,9 +32,33 @@ 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. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -43,7 +69,7 @@ public interface Accounts { /** * List Account resources by resource group. - * + * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -55,55 +81,55 @@ 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. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -114,7 +140,7 @@ public interface Accounts { /** * Get a Account. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -126,7 +152,7 @@ public interface Accounts { /** * Delete a Account. - * + * * @param id the resource ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -136,7 +162,7 @@ public interface Accounts { /** * Delete a Account. - * + * * @param id the resource ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -147,7 +173,7 @@ public interface Accounts { /** * Begins definition for a new Account resource. - * + * * @param name resource name. * @return the first stage of the new Account definition. */ 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 a29437068429..10f36fc20dd2 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ +/** + * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + */ public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ + /** + * Static value Internal for ActionType. + */ public static final ActionType INTERNAL = fromString("Internal"); /** * Creates a new instance of ActionType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public ActionType() { /** * Creates or finds a ActionType from its string representation. - * + * * @param name a name to look for. * @return the corresponding ActionType. */ @@ -35,7 +39,7 @@ public static ActionType fromString(String name) { /** * Gets known ActionType values. - * + * * @return known ActionType values. */ public static Collection values() { 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 000000000000..3c98c3852f75 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityReason.java @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.playwrighttesting.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +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. + */ + @JsonCreator + 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 000000000000..d3cf59825448 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/CheckNameAvailabilityRequest.java @@ -0,0 +1,80 @@ +// 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.fasterxml.jackson.annotation.JsonProperty; + +/** + * The check availability request body. + */ +@Fluent +public final class CheckNameAvailabilityRequest { + /* + * The name of the resource for which availability needs to be checked. + */ + @JsonProperty(value = "name") + private String name; + + /* + * The resource type. + */ + @JsonProperty(value = "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() { + } +} 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 000000000000..c157383870c9 --- /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 2a144fdc5f5a..5d227df73140 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 @@ -8,17 +8,23 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The enablement status of a feature. */ +/** + * The enablement status of a feature. + */ public final class EnablementStatus extends ExpandableStringEnum { - /** Static value Enabled for EnablementStatus. */ + /** + * Static value Enabled for EnablementStatus. + */ public static final EnablementStatus ENABLED = fromString("Enabled"); - /** Static value Disabled for EnablementStatus. */ + /** + * Static value Disabled for EnablementStatus. + */ public static final EnablementStatus DISABLED = fromString("Disabled"); /** * Creates a new instance of EnablementStatus value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +33,7 @@ public EnablementStatus() { /** * Creates or finds a EnablementStatus from its string representation. - * + * * @param name a name to look for. * @return the corresponding EnablementStatus. */ @@ -38,7 +44,7 @@ public static EnablementStatus fromString(String name) { /** * Gets known EnablementStatus values. - * + * * @return known EnablementStatus values. */ public static Collection values() { 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 5944a3cc225e..d6c861d0c45c 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 @@ -6,115 +6,42 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -/** The free-trial properties. */ +/** + * The subscription quota resource free-trial properties. + */ @Immutable public final class FreeTrialProperties { /* - * 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; - /** Creates an instance of FreeTrialProperties class. */ + /** + * Creates an instance of FreeTrialProperties class. + */ public FreeTrialProperties() { } /** - * Get the accountId property: The playwright account id. - * + * Get the accountId property: The Playwright service account id. + * * @return the accountId value. */ public String accountId() { return this.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. - * - * @return the usedValue value. - */ - public int usedValue() { - return this.usedValue; - } - - /** - * Get the percentageUsed property: The free-trial percentage used. - * - * @return the percentageUsed value. - */ - public BigDecimal percentageUsed() { - return this.percentageUsed; - } - /** * Get the state property: The free-trial state. - * + * * @return the state value. */ public FreeTrialState state() { @@ -123,7 +50,7 @@ public FreeTrialState state() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 a119fa50e886..0d62bdf17d81 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 @@ -8,17 +8,33 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The free-trial state. */ +/** + * The free-trial state. + */ public final class FreeTrialState extends ExpandableStringEnum { - /** Static value Active for FreeTrialState. */ + /** + * Static value Active for FreeTrialState. + */ public static final FreeTrialState ACTIVE = fromString("Active"); - /** Static value Expired for FreeTrialState. */ + /** + * Static value Expired for FreeTrialState. + */ 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. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -27,7 +43,7 @@ public FreeTrialState() { /** * Creates or finds a FreeTrialState from its string representation. - * + * * @param name a name to look for. * @return the corresponding FreeTrialState. */ @@ -38,7 +54,7 @@ public static FreeTrialState fromString(String name) { /** * Gets known FreeTrialState values. - * + * * @return known FreeTrialState values. */ public static Collection values() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operation.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operation.java index b4c80c593ef8..7b958d42840d 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operation.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operation.java @@ -6,12 +6,14 @@ import com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner; -/** An immutable client-side representation of Operation. */ +/** + * An immutable client-side representation of Operation. + */ public interface Operation { /** * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * + * * @return the name value. */ String name(); @@ -19,14 +21,14 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane * operations and "false" for ARM/control-plane operations. - * + * * @return the isDataAction value. */ Boolean isDataAction(); /** * Gets the display property: Localized display information for this particular operation. - * + * * @return the display value. */ OperationDisplay display(); @@ -34,7 +36,7 @@ public interface Operation { /** * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". - * + * * @return the origin value. */ Origin origin(); @@ -42,14 +44,14 @@ public interface Operation { /** * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal * only APIs. - * + * * @return the actionType value. */ ActionType actionType(); /** * Gets the inner com.azure.resourcemanager.playwrighttesting.fluent.models.OperationInner object. - * + * * @return the inner object. */ OperationInner innerModel(); 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 6ae7c0644d6a..ff327e196afd 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 @@ -7,7 +7,9 @@ import com.azure.core.annotation.Immutable; import com.fasterxml.jackson.annotation.JsonProperty; -/** Localized display information for this particular operation. */ +/** + * Localized display information for this particular operation. + */ @Immutable public final class OperationDisplay { /* @@ -37,14 +39,16 @@ public final class OperationDisplay { @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) private String description; - /** Creates an instance of OperationDisplay class. */ + /** + * Creates an instance of OperationDisplay class. + */ public OperationDisplay() { } /** * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring * Insights" or "Microsoft Compute". - * + * * @return the provider value. */ public String provider() { @@ -54,7 +58,7 @@ public String provider() { /** * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. * "Virtual Machines" or "Job Schedule Collections". - * + * * @return the resource value. */ public String resource() { @@ -64,7 +68,7 @@ public String resource() { /** * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. * "Create or Update Virtual Machine", "Restart Virtual Machine". - * + * * @return the operation value. */ public String operation() { @@ -74,7 +78,7 @@ public String operation() { /** * Get the description property: The short, localized friendly description of the operation; suitable for tool tips * and detailed views. - * + * * @return the description value. */ public String description() { @@ -83,7 +87,7 @@ public String description() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 dfa4da419998..7de4d0ad99c8 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 @@ -10,8 +10,8 @@ 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 { @@ -27,13 +27,15 @@ public final class OperationListResult { @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; - /** Creates an instance of OperationListResult class. */ + /** + * Creates an instance of OperationListResult class. + */ public OperationListResult() { } /** * Get the value property: List of operations supported by the resource provider. - * + * * @return the value value. */ public List value() { @@ -42,7 +44,7 @@ public List value() { /** * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * + * * @return the nextLink value. */ public String nextLink() { @@ -51,7 +53,7 @@ public String nextLink() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operations.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operations.java index bc131a56c05d..f775dcdebb88 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operations.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Operations.java @@ -7,27 +7,29 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -/** Resource collection API of Operations. */ +/** + * Resource collection API of Operations. + */ public interface Operations { /** * List the operations for the provider. - * + * * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(); /** * List the operations for the provider. - * + * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with {@link - * PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable list(Context context); } 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 171a13de53cd..e32f0e51a0e1 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 @@ -13,18 +13,24 @@ * is "user,system". */ public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ + /** + * Static value user for Origin. + */ public static final Origin USER = fromString("user"); - /** Static value system for Origin. */ + /** + * Static value system for Origin. + */ public static final Origin SYSTEM = fromString("system"); - /** Static value user,system for Origin. */ + /** + * Static value user,system for Origin. + */ public static final Origin USER_SYSTEM = fromString("user,system"); /** * Creates a new instance of Origin value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -33,7 +39,7 @@ public Origin() { /** * Creates or finds a Origin from its string representation. - * + * * @param name a name to look for. * @return the corresponding Origin. */ @@ -44,7 +50,7 @@ public static Origin fromString(String name) { /** * Gets known Origin values. - * + * * @return known Origin values. */ public static Collection values() { 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 9482f727613e..a2cf81f40184 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 @@ -8,26 +8,43 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** The status of the current operation. */ +/** + * The status of the current operation. + */ public final class ProvisioningState extends ExpandableStringEnum { - /** Static value Succeeded for ProvisioningState. */ + /** + * Static value Succeeded for ProvisioningState. + */ public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); - /** Static value Failed for ProvisioningState. */ + /** + * Static value Failed for ProvisioningState. + */ public static final ProvisioningState FAILED = fromString("Failed"); - /** Static value Canceled for ProvisioningState. */ + /** + * Static value Canceled for ProvisioningState. + */ public static final ProvisioningState CANCELED = fromString("Canceled"); - /** Static value Deleting for ProvisioningState. */ + /** + * Static value Creating for ProvisioningState. + */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Deleting for ProvisioningState. + */ public static final ProvisioningState DELETING = fromString("Deleting"); - /** Static value Accepted for ProvisioningState. */ + /** + * Static value Accepted for ProvisioningState. + */ public static final ProvisioningState ACCEPTED = fromString("Accepted"); /** * Creates a new instance of ProvisioningState value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -36,7 +53,7 @@ public ProvisioningState() { /** * Creates or finds a ProvisioningState from its string representation. - * + * * @param name a name to look for. * @return the corresponding ProvisioningState. */ @@ -47,7 +64,7 @@ public static ProvisioningState fromString(String name) { /** * Gets known ProvisioningState values. - * + * * @return known ProvisioningState values. */ public static Collection values() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quota.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quota.java index 9cd1ec81e977..93925d0392a0 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quota.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/Quota.java @@ -7,53 +7,48 @@ import com.azure.core.management.SystemData; import com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner; -/** An immutable client-side representation of Quota. */ +/** + * An immutable client-side representation of Quota. + */ public interface Quota { /** * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. - * - * @return the systemData value. + * Gets the properties property: The resource-specific properties for this resource. + * + * @return the properties value. */ - SystemData systemData(); + QuotaProperties properties(); /** - * Gets the freeTrial property: The free-trial quota. - * - * @return the freeTrial value. - */ - FreeTrialProperties freeTrial(); - - /** - * Gets the provisioningState property: The status of the last operation. - * - * @return the provisioningState value. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. */ - ProvisioningState provisioningState(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.playwrighttesting.fluent.models.QuotaInner object. - * + * * @return the inner object. */ QuotaInner innerModel(); diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaListResult.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaListResult.java index 83bb7fefff05..756727e453b0 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaListResult.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaListResult.java @@ -10,7 +10,9 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; -/** The response of a Quota list operation. */ +/** + * The response of a Quota list operation. + */ @Fluent public final class QuotaListResult { /* @@ -25,13 +27,15 @@ public final class QuotaListResult { @JsonProperty(value = "nextLink") private String nextLink; - /** Creates an instance of QuotaListResult class. */ + /** + * Creates an instance of QuotaListResult class. + */ public QuotaListResult() { } /** * Get the value property: The Quota items on this page. - * + * * @return the value value. */ public List value() { @@ -40,7 +44,7 @@ public List value() { /** * Set the value property: The Quota items on this page. - * + * * @param value the value value to set. * @return the QuotaListResult object itself. */ @@ -51,7 +55,7 @@ public QuotaListResult withValue(List value) { /** * Get the nextLink property: The link to the next page of items. - * + * * @return the nextLink value. */ public String nextLink() { @@ -60,7 +64,7 @@ public String nextLink() { /** * Set the nextLink property: The link to the next page of items. - * + * * @param nextLink the nextLink value to set. * @return the QuotaListResult object itself. */ @@ -71,14 +75,13 @@ public QuotaListResult withNextLink(String nextLink) { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model QuotaListResult")); + throw LOGGER.logExceptionAsError( + new IllegalArgumentException("Missing required property value in model QuotaListResult")); } else { value().forEach(e -> e.validate()); } 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 65672219a515..cf80ec67e484 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 @@ -8,14 +8,18 @@ import com.fasterxml.jackson.annotation.JsonCreator; import java.util.Collection; -/** Defines values for QuotaNames. */ +/** + * Defines values for QuotaNames. + */ public final class QuotaNames extends ExpandableStringEnum { - /** Static value ScalableExecution for QuotaNames. */ + /** + * Static value ScalableExecution for QuotaNames. + */ public static final QuotaNames SCALABLE_EXECUTION = fromString("ScalableExecution"); /** * Creates a new instance of QuotaNames value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Deprecated @@ -24,7 +28,7 @@ public QuotaNames() { /** * Creates or finds a QuotaNames from its string representation. - * + * * @param name a name to look for. * @return the corresponding QuotaNames. */ @@ -35,7 +39,7 @@ public static QuotaNames fromString(String name) { /** * Gets known QuotaNames values. - * + * * @return known QuotaNames values. */ public static Collection values() { diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaProperties.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java similarity index 75% rename from sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaProperties.java rename to sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java index a2dea8d0cb5f..44ed37f584b7 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/fluent/models/QuotaProperties.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/QuotaProperties.java @@ -2,18 +2,18 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.playwrighttesting.fluent.models; +package com.azure.resourcemanager.playwrighttesting.models; import com.azure.core.annotation.Fluent; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; -import com.azure.resourcemanager.playwrighttesting.models.ProvisioningState; import com.fasterxml.jackson.annotation.JsonProperty; -/** Quota properties. */ +/** + * The subscription quota resource properties. + */ @Fluent public final class QuotaProperties { /* - * The free-trial quota. + * The subscription quota resource free-trial properties. */ @JsonProperty(value = "freeTrial") private FreeTrialProperties freeTrial; @@ -24,13 +24,15 @@ public final class QuotaProperties { @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) private ProvisioningState provisioningState; - /** Creates an instance of QuotaProperties class. */ + /** + * Creates an instance of QuotaProperties class. + */ 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. */ public FreeTrialProperties freeTrial() { @@ -38,8 +40,8 @@ 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,7 +52,7 @@ public QuotaProperties withFreeTrial(FreeTrialProperties freeTrial) { /** * Get the provisioningState property: The status of the last operation. - * + * * @return the provisioningState value. */ public ProvisioningState provisioningState() { @@ -59,7 +61,7 @@ public ProvisioningState provisioningState() { /** * Validates the instance. - * + * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { 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 56d8b7da4246..e63189de4da5 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 @@ -8,11 +8,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -/** Resource collection API of Quotas. */ +/** + * Resource collection API of Quotas. + */ public interface Quotas { /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -23,7 +25,7 @@ public interface Quotas { /** * List quotas for a given subscription Id. - * + * * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -34,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/com/azure/resourcemanager/playwrighttesting/models/package-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/package-info.java index 1296669efdcd..a243aff14111 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/package-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/models/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the data models for PlaywrightTestingMgmtClient. Azure Playwright testing management service. */ +/** + * Package containing the data models for PlaywrightTestingMgmtClient. + * Azure Playwright testing management service. + */ package com.azure.resourcemanager.playwrighttesting.models; diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/package-info.java b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/package-info.java index c1489f8c52a5..097ddc0623a1 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/package-info.java +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/java/com/azure/resourcemanager/playwrighttesting/package-info.java @@ -2,5 +2,8 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -/** Package containing the classes for PlaywrightTestingMgmtClient. Azure Playwright testing management service. */ +/** + * Package containing the classes for PlaywrightTestingMgmtClient. + * Azure Playwright testing management service. + */ package com.azure.resourcemanager.playwrighttesting; 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 b5cbdc9f224b..c74a62f2bf39 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,10 +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, com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.playwrighttesting.models to com.azure.core, com.fasterxml.jackson.databind; } 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 new file mode 100644 index 000000000000..5ea7c6affbd7 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/proxy-config.json @@ -0,0 +1 @@ +[ [ "com.azure.resourcemanager.playwrighttesting.implementation.OperationsClientImpl$OperationsService" ], [ "com.azure.resourcemanager.playwrighttesting.implementation.AccountsClientImpl$AccountsService" ], [ "com.azure.resourcemanager.playwrighttesting.implementation.QuotasClientImpl$QuotasService" ], [ "com.azure.resourcemanager.playwrighttesting.implementation.AccountQuotasClientImpl$AccountQuotasService" ] ] \ 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 new file mode 100644 index 000000000000..f0a5f4c6d9bc --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-playwrighttesting/reflect-config.json @@ -0,0 +1,126 @@ +[ { + "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.CheckNameAvailabilityRequest", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.playwrighttesting.fluent.models.CheckNameAvailabilityResponseInner", + "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.AccountQuotaListResult", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.playwrighttesting.fluent.models.AccountQuotaInner", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountQuotaProperties", + "allDeclaredConstructors" : true, + "allDeclaredFields" : true, + "allDeclaredMethods" : true +}, { + "name" : "com.azure.resourcemanager.playwrighttesting.models.AccountFreeTrialProperties", + "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.CheckNameAvailabilityReason", + "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 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 000000000000..a5d72da70b4c --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountQuotasGetSamples.java @@ -0,0 +1,27 @@ +// 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-02-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 000000000000..3a2b4adb13f7 --- /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-02-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 000000000000..7ed22a481e22 --- /dev/null +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/samples/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCheckNameAvailabilitySamples.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.CheckNameAvailabilityRequest; + +/** + * Samples for Accounts CheckNameAvailability. + */ +public final class AccountsCheckNameAvailabilitySamples { + /* + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-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 536bda8ebc55..1c8b2f7d0ced 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 @@ -4,30 +4,30 @@ package com.azure.resourcemanager.playwrighttesting.generated; +import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; import java.util.HashMap; import java.util.Map; -/** Samples for Accounts CreateOrUpdate. */ +/** + * Samples for Accounts CreateOrUpdate. + */ public final class AccountsCreateOrUpdateSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_CreateOrUpdate.json */ /** * Sample code: Accounts_CreateOrUpdate. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsCreateOrUpdate( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager - .accounts() - .define("myPlaywrightAccount") - .withRegion("westus") - .withExistingResourceGroup("dummyrg") + public static void + accountsCreateOrUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accounts().define("myPlaywrightAccount").withRegion("westus").withExistingResourceGroup("dummyrg") .withTags(mapOf("Team", "Dev Exp")) - .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 054624313ab9..3fc7c7547983 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Accounts Delete. */ +/** + * Samples for Accounts Delete. + */ public final class AccountsDeleteSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_Delete.json */ /** * Sample code: Accounts_Delete. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsDelete(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { 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 c09fc355a905..630136b3deb9 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 @@ -4,19 +4,22 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Accounts GetByResourceGroup. */ +/** + * Samples for Accounts GetByResourceGroup. + */ public final class AccountsGetByResourceGroupSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_Get.json */ /** * Sample code: Accounts_Get. - * + * * @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 b4b67b2a3a8a..d419f2df1f93 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Accounts ListByResourceGroup. */ +/** + * Samples for Accounts ListByResourceGroup. + */ public final class AccountsListByResourceGroupSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_ListByResourceGroup.json */ /** * Sample code: Accounts_ListByResourceGroup. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsListByResourceGroup( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void + accountsListByResourceGroup(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.accounts().listByResourceGroup("dummyrg", com.azure.core.util.Context.NONE); } } 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 0dee2e5683e2..6ef15392b268 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Accounts List. */ +/** + * Samples for Accounts List. + */ public final class AccountsListSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_ListBySubscription.json */ /** * Sample code: Accounts_ListBySubscription. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsListBySubscription( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void + accountsListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.accounts().list(com.azure.core.util.Context.NONE); } } 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 2e81197ccf3c..2db568518b5f 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 @@ -5,31 +5,31 @@ package com.azure.resourcemanager.playwrighttesting.generated; import com.azure.resourcemanager.playwrighttesting.models.Account; +import com.azure.resourcemanager.playwrighttesting.models.AccountUpdateProperties; import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; import java.util.HashMap; import java.util.Map; -/** Samples for Accounts Update. */ +/** + * Samples for Accounts Update. + */ public final class AccountsUpdateSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Accounts_Update.json */ /** * Sample code: Accounts_Update. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void accountsUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - Account resource = - manager - .accounts() - .getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withTags(mapOf("Division", "LT", "Team", "Dev Exp")) - .withRegionalAffinity(EnablementStatus.ENABLED) - .apply(); + 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(); } // 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 8e2ee64569b1..85f66807b5ee 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 @@ -4,14 +4,18 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Operations List. */ +/** + * Samples for Operations List. + */ public final class OperationsListSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Operations_List.json */ /** * Sample code: Operations_List. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void operationsList(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { 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 514a3fa17d92..8fa07f5294be 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 @@ -6,14 +6,18 @@ import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; -/** Samples for Quotas Get. */ +/** + * Samples for Quotas Get. + */ public final class QuotasGetSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Quotas_Get.json */ /** * Sample code: Quotas_Get. - * + * * @param manager Entry point to PlaywrightTestingManager. */ public static void quotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { 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 9d4d4cf053b0..9b396657ebec 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 @@ -4,18 +4,22 @@ package com.azure.resourcemanager.playwrighttesting.generated; -/** Samples for Quotas ListBySubscription. */ +/** + * Samples for Quotas ListBySubscription. + */ public final class QuotasListBySubscriptionSamples { /* - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json + * x-ms-original-file: + * specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-02-01/examples/ + * Quotas_ListBySubscription.json */ /** * Sample code: Quotas_ListBySubscription. - * + * * @param manager Entry point to PlaywrightTestingManager. */ - public static void quotasListBySubscription( - com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + public static void + quotasListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { manager.quotas().listBySubscription("eastus", com.azure.core.util.Context.NONE); } } 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 66f0908277fe..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountInnerTests.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.util.BinaryData; -import com.azure.resourcemanager.playwrighttesting.fluent.models.AccountInner; -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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountInner model = - new AccountInner() - .withLocation("htnapczwlokjyem") - .withTags(mapOf("joxzjnchgejspodm", "ni", "h", "ilzyd")) - .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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.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 cc01f77fbcef..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountListResultTests.java +++ /dev/null @@ -1,66 +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.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).regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).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")) - .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).regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, model.value().get(0).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 31bd43834690..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountPropertiesTests.java +++ /dev/null @@ -1,37 +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.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 6bd2c3d49644..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdatePropertiesTests.java +++ /dev/null @@ -1,37 +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.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 7bb6c78d6d24..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountUpdateTests.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.models.AccountUpdate; -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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.reporting()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AccountUpdate model = - new AccountUpdate() - .withTags(mapOf("wrwclxxwrljd", "ntnbybkzg", "kwt", "uskcqvkocrcj", "ssainqpjwnzll", "hxbnjbiksqrg")) - .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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, model.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 9cddc452d6d8..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,95 +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 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")) - .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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.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 a5c551d4980e..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsDeleteMockTests.java +++ /dev/null @@ -1,61 +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 a0b55a2f3cb5..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,75 +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.regionalAffinity()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.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 67d50ed4c0f3..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListByResourceGroupMockTests.java +++ /dev/null @@ -1,73 +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().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().scalableExecution()); - Assertions.assertEquals(EnablementStatus.ENABLED, response.iterator().next().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 397934bf493c..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/AccountsListMockTests.java +++ /dev/null @@ -1,72 +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().regionalAffinity()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().scalableExecution()); - Assertions.assertEquals(EnablementStatus.DISABLED, response.iterator().next().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 036139abfe28..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/FreeTrialPropertiesTests.java +++ /dev/null @@ -1,25 +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 a423fb330fc0..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +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 de1d1193160b..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationInnerTests.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.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 1f2a14460b0b..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +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 bcb2a9d72a01..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/OperationsListMockTests.java +++ /dev/null @@ -1,64 +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 77965fe70d6a..000000000000 --- 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; - -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().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 e66a2a7d7c7a..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaListResultTests.java +++ /dev/null @@ -1,40 +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 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().withFreeTrial(new FreeTrialProperties()), - new QuotaInner().withFreeTrial(new FreeTrialProperties()), - new QuotaInner().withFreeTrial(new FreeTrialProperties()), - new QuotaInner().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 289a6731928c..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotaPropertiesTests.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.QuotaProperties; -import com.azure.resourcemanager.playwrighttesting.models.FreeTrialProperties; - -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 a673834a5477..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasGetWithResponseMockTests.java +++ /dev/null @@ -1,68 +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 3228f343603c..000000000000 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/src/test/java/com/azure/resourcemanager/playwrighttesting/generated/QuotasListBySubscriptionMockTests.java +++ /dev/null @@ -1,64 +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); - } -}