From 588304399f69c64105694643da4d417e22b92ef9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 8 Apr 2025 09:54:02 +0000 Subject: [PATCH] CodeGen from PR 33240 in Azure/azure-rest-api-specs Merge 933efc21342dbe3e5a61a94c48a8cc7578a95457 into abb839b726184aa10f8d1eaac8e9fe590833619c --- .../CHANGELOG.md | 10 +- .../README.md | 14 +- .../SAMPLE.md | 202 +++++++++--------- .../pom.xml | 1 - .../tsp-location.yaml | 2 +- 5 files changed, 114 insertions(+), 115 deletions(-) diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md index 6d46b7dc5944..42751ae8a52f 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/CHANGELOG.md @@ -1,14 +1,8 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.1 (2025-04-08) -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Azure Resource Manager Playwright Testing client library for Java. This package contains Microsoft Azure SDK for Playwright Testing Management SDK. Microsoft.AzurePlaywrightService Resource Provider Management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0 (2024-12-16) diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md index 6c4313bcf4c0..3c1fa52b5a15 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/README.md @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ PlaywrightTestingManager manager = PlaywrightTestingManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -70,6 +70,14 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +account = playwrightTestingManager.accounts() + .define(accountName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md) @@ -100,5 +108,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md index e35a460bfe2e..35481cf93da3 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md @@ -24,24 +24,44 @@ ### AccountQuotas_Get ```java -import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; +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 AccountQuotas Get. + * Samples for Accounts Update. */ -public final class AccountQuotasGetSamples { +public final class AccountsUpdateSamples { /* - * x-ms-original-file: 2024-12-01/AccountQuotas_Get.json + * x-ms-original-file: 2024-12-01/Accounts_Update.json */ /** - * Sample code: AccountQuotas_Get. + * Sample code: Accounts_Update. * * @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); + 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("Team", "Dev Exp", "Division", "LT")) + .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)) + .apply(); + } + + // 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; } } ``` @@ -50,20 +70,19 @@ public final class AccountQuotasGetSamples { ```java /** - * Samples for AccountQuotas ListByAccount. + * Samples for Accounts Delete. */ -public final class AccountQuotasListByAccountSamples { +public final class AccountsDeleteSamples { /* - * x-ms-original-file: 2024-12-01/AccountQuotas_ListByAccount.json + * x-ms-original-file: 2024-12-01/Accounts_Delete.json */ /** - * Sample code: AccountQuotas_ListByAccount. + * Sample code: Accounts_Delete. * * @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); + public static void accountsDelete(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accounts().delete("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); } } ``` @@ -97,44 +116,20 @@ public final class AccountsCheckNameAvailabilitySamples { ### 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; - /** - * Samples for Accounts CreateOrUpdate. + * Samples for Operations List. */ -public final class AccountsCreateOrUpdateSamples { +public final class OperationsListSamples { /* - * x-ms-original-file: 2024-12-01/Accounts_CreateOrUpdate.json + * x-ms-original-file: 2024-12-01/Operations_List.json */ /** - * Sample code: Accounts_CreateOrUpdate. + * Sample code: Operations_List. * * @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")) - .withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)) - .create(); - } - - // 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; + public static void operationsList(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.operations().list(com.azure.core.util.Context.NONE); } } ``` @@ -143,19 +138,20 @@ public final class AccountsCreateOrUpdateSamples { ```java /** - * Samples for Accounts Delete. + * Samples for Quotas ListBySubscription. */ -public final class AccountsDeleteSamples { +public final class QuotasListBySubscriptionSamples { /* - * x-ms-original-file: 2024-12-01/Accounts_Delete.json + * x-ms-original-file: 2024-12-01/Quotas_ListBySubscription.json */ /** - * Sample code: Accounts_Delete. + * Sample code: Quotas_ListBySubscription. * * @param manager Entry point to PlaywrightTestingManager. */ - public static void accountsDelete(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.accounts().delete("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); + public static void + quotasListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.quotas().listBySubscription("eastus", com.azure.core.util.Context.NONE); } } ``` @@ -163,44 +159,22 @@ public final class AccountsDeleteSamples { ### Accounts_Update ```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 com.azure.resourcemanager.playwrighttesting.models.QuotaNames; /** - * Samples for Accounts Update. + * Samples for Quotas Get. */ -public final class AccountsUpdateSamples { +public final class QuotasGetSamples { /* - * x-ms-original-file: 2024-12-01/Accounts_Update.json + * x-ms-original-file: 2024-12-01/Quotas_Get.json */ /** - * Sample code: Accounts_Update. + * Sample code: Quotas_Get. * * @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("Team", "Dev Exp", "Division", "LT")) - .withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)) - .apply(); - } - - // 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; + public static void quotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.quotas().getWithResponse("eastus", QuotaNames.SCALABLE_EXECUTION, com.azure.core.util.Context.NONE); } } ``` @@ -209,19 +183,20 @@ public final class AccountsUpdateSamples { ```java /** - * Samples for Operations List. + * Samples for AccountQuotas ListByAccount. */ -public final class OperationsListSamples { +public final class AccountQuotasListByAccountSamples { /* - * x-ms-original-file: 2024-12-01/Operations_List.json + * x-ms-original-file: 2024-12-01/AccountQuotas_ListByAccount.json */ /** - * Sample code: Operations_List. + * Sample code: AccountQuotas_ListByAccount. * * @param manager Entry point to PlaywrightTestingManager. */ - public static void operationsList(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); + public static void + accountQuotasListByAccount(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { + manager.accountQuotas().listByAccount("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE); } } ``` @@ -229,22 +204,44 @@ public final class OperationsListSamples { ### Quotas_Get ```java -import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; +import com.azure.resourcemanager.playwrighttesting.models.AccountProperties; +import com.azure.resourcemanager.playwrighttesting.models.EnablementStatus; +import java.util.HashMap; +import java.util.Map; /** - * Samples for Quotas Get. + * Samples for Accounts CreateOrUpdate. */ -public final class QuotasGetSamples { +public final class AccountsCreateOrUpdateSamples { /* - * x-ms-original-file: 2024-12-01/Quotas_Get.json + * x-ms-original-file: 2024-12-01/Accounts_CreateOrUpdate.json */ /** - * Sample code: Quotas_Get. + * Sample code: Accounts_CreateOrUpdate. * * @param manager Entry point to PlaywrightTestingManager. */ - public static void quotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.quotas().getWithResponse("eastus", QuotaNames.SCALABLE_EXECUTION, com.azure.core.util.Context.NONE); + 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 + @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; } } ``` @@ -252,21 +249,24 @@ public final class QuotasGetSamples { ### Quotas_ListBySubscription ```java +import com.azure.resourcemanager.playwrighttesting.models.QuotaNames; + /** - * Samples for Quotas ListBySubscription. + * Samples for AccountQuotas Get. */ -public final class QuotasListBySubscriptionSamples { +public final class AccountQuotasGetSamples { /* - * x-ms-original-file: 2024-12-01/Quotas_ListBySubscription.json + * x-ms-original-file: 2024-12-01/AccountQuotas_Get.json */ /** - * Sample code: Quotas_ListBySubscription. + * Sample code: AccountQuotas_Get. * * @param manager Entry point to PlaywrightTestingManager. */ - public static void - quotasListBySubscription(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) { - manager.quotas().listBySubscription("eastus", com.azure.core.util.Context.NONE); + 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/pom.xml b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml index 266868dc329a..b2b2d7ee888d 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/pom.xml @@ -46,7 +46,6 @@ 0 0 true - false diff --git a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/tsp-location.yaml b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/tsp-location.yaml index 9dc967fa3148..88e2f7d86a8e 100644 --- a/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/tsp-location.yaml +++ b/sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/playwrighttesting/PlaywrightTesting.Management -commit: 6f175c9c006269a1d0f1928fbc768cacc6ac379a +commit: ab072b2effd79895e3ab4ff1c120e61e1c2ea7ba repo: Azure/azure-rest-api-specs additionalDirectories: