Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR azure-resourcemanager-playwrighttesting] Batch 6 sdk gen test #11903

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.3 (Unreleased)
## 1.0.0-beta.1 (2024-08-28)

- 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-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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-preview. 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

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-playwrighttesting</artifactId>
<version>1.0.0-beta.2</version>
<version>1.0.0-beta.3</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand All @@ -45,15 +45,11 @@ Azure Management Libraries require a `TokenCredential` implementation for authen

### Authentication

By default, Microsoft Entra ID token authentication depends on correct configuration of the following environment variables.
Microsoft Entra ID token authentication relies on the [credential class][azure_identity_credentials] from [Azure Identity][azure_identity] package.

- `AZURE_CLIENT_ID` for Azure client ID.
- `AZURE_TENANT_ID` for Azure tenant ID.
- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

In addition, Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment variable.

With above configuration, `azure` client can be authenticated using the following code:
Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code:

```java
AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
Expand Down Expand Up @@ -97,6 +93,7 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/identity/azure-identity#credentials
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
Expand Down
121 changes: 106 additions & 15 deletions sdk/playwrighttesting/azure-resourcemanager-playwrighttesting/SAMPLE.md
Original file line number Diff line number Diff line change
@@ -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)
Expand All @@ -18,6 +24,85 @@

- [Get](#quotas_get)
- [ListBySubscription](#quotas_listbysubscription)
### AccountQuotas_Get

```java
import com.azure.resourcemanager.playwrighttesting.models.QuotaNames;

/**
* Samples for AccountQuotas Get.
*/
public final class AccountQuotasGetSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* 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/preview/2024-02-01-preview/
* 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/preview/2024-02-01-preview/
* 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
Expand All @@ -32,7 +117,7 @@ import java.util.Map;
public final class AccountsCreateOrUpdateSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_CreateOrUpdate.json
*/
/**
Expand All @@ -42,9 +127,13 @@ public final class AccountsCreateOrUpdateSamples {
*/
public static void
accountsCreateOrUpdate(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) {
manager.accounts().define("myPlaywrightAccount").withRegion("westus").withExistingResourceGroup("dummyrg")
manager.accounts()
.define("myPlaywrightAccount")
.withRegion("westus")
.withExistingResourceGroup("dummyrg")
.withTags(mapOf("Team", "Dev Exp"))
.withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED)).create();
.withProperties(new AccountProperties().withRegionalAffinity(EnablementStatus.ENABLED))
.create();
}

// Use "Map.of" if available
Expand All @@ -70,7 +159,7 @@ public final class AccountsCreateOrUpdateSamples {
public final class AccountsDeleteSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_Delete.json
*/
/**
Expand All @@ -93,7 +182,7 @@ public final class AccountsDeleteSamples {
public final class AccountsGetByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_Get.json
*/
/**
Expand All @@ -102,8 +191,8 @@ public final class AccountsGetByResourceGroupSamples {
* @param manager Entry point to PlaywrightTestingManager.
*/
public static void accountsGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) {
manager.accounts().getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount",
com.azure.core.util.Context.NONE);
manager.accounts()
.getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE);
}
}
```
Expand All @@ -117,7 +206,7 @@ public final class AccountsGetByResourceGroupSamples {
public final class AccountsListSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_ListBySubscription.json
*/
/**
Expand All @@ -141,7 +230,7 @@ public final class AccountsListSamples {
public final class AccountsListByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_ListByResourceGroup.json
*/
/**
Expand Down Expand Up @@ -171,7 +260,7 @@ import java.util.Map;
public final class AccountsUpdateSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Accounts_Update.json
*/
/**
Expand All @@ -183,8 +272,10 @@ public final class AccountsUpdateSamples {
Account resource = manager.accounts()
.getByResourceGroupWithResponse("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE)
.getValue();
resource.update().withTags(mapOf("Division", "LT", "Team", "Dev Exp"))
.withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED)).apply();
resource.update()
.withTags(mapOf("Division", "LT", "Team", "Dev Exp"))
.withProperties(new AccountUpdateProperties().withRegionalAffinity(EnablementStatus.ENABLED))
.apply();
}

// Use "Map.of" if available
Expand All @@ -210,7 +301,7 @@ public final class AccountsUpdateSamples {
public final class OperationsListSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Operations_List.json
*/
/**
Expand All @@ -235,7 +326,7 @@ import com.azure.resourcemanager.playwrighttesting.models.QuotaNames;
public final class QuotasGetSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Quotas_Get.json
*/
/**
Expand All @@ -258,7 +349,7 @@ public final class QuotasGetSamples {
public final class QuotasListBySubscriptionSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2024-02-01-preview/
* examples/Quotas_ListBySubscription.json
*/
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for Playwright Testing Management</name>
<description>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.</description>
<description>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-preview.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -48,6 +48,11 @@
<revapi.skip>true</revapi.skip>
</properties>
<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Expand Down
Loading