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] Release playwrighttesting microsoft.playwright testing/2024-12-01 #13361

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-11-21)

- Azure Resource Manager Playwright Testing client library for Java. This package contains Microsoft Azure SDK for Playwright Testing Management SDK. Azure Playwright testing management service. Package tag package-2024-12-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

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

## We'd love to hear your feedback

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
139 changes: 115 additions & 24 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/stable/2024-12-01/examples/
* AccountQuotas_Get.json
*/
/**
* Sample code: AccountQuotas_Get.
*
* @param manager Entry point to PlaywrightTestingManager.
*/
public static void accountQuotasGet(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) {
manager.accountQuotas()
.getWithResponse("dummyrg", "myPlaywrightAccount", QuotaNames.SCALABLE_EXECUTION,
com.azure.core.util.Context.NONE);
}
}
```

### AccountQuotas_ListByAccount

```java
/**
* Samples for AccountQuotas ListByAccount.
*/
public final class AccountQuotasListByAccountSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* AccountQuotas_ListByAccount.json
*/
/**
* Sample code: AccountQuotas_ListByAccount.
*
* @param manager Entry point to PlaywrightTestingManager.
*/
public static void
accountQuotasListByAccount(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) {
manager.accountQuotas().listByAccount("dummyrg", "myPlaywrightAccount", com.azure.core.util.Context.NONE);
}
}
```

### Accounts_CheckNameAvailability

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

/**
* Samples for Accounts CheckNameAvailability.
*/
public final class AccountsCheckNameAvailabilitySamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_CheckNameAvailability.json
*/
/**
* Sample code: Accounts_CheckNameAvailability.
*
* @param manager Entry point to PlaywrightTestingManager.
*/
public static void
accountsCheckNameAvailability(com.azure.resourcemanager.playwrighttesting.PlaywrightTestingManager manager) {
manager.accounts()
.checkNameAvailabilityWithResponse(new CheckNameAvailabilityRequest().withName("dummyName")
.withType("Microsoft.AzurePlaywrightService/Accounts"), com.azure.core.util.Context.NONE);
}
}
```

### Accounts_CreateOrUpdate

```java
Expand All @@ -32,8 +117,8 @@ import java.util.Map;
public final class AccountsCreateOrUpdateSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_CreateOrUpdate.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_CreateOrUpdate.json
*/
/**
* Sample code: Accounts_CreateOrUpdate.
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,8 +159,8 @@ public final class AccountsCreateOrUpdateSamples {
public final class AccountsDeleteSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_Delete.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_Delete.json
*/
/**
* Sample code: Accounts_Delete.
Expand All @@ -93,17 +182,17 @@ public final class AccountsDeleteSamples {
public final class AccountsGetByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_Get.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_Get.json
*/
/**
* Sample code: Accounts_Get.
*
* @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,8 +206,8 @@ public final class AccountsGetByResourceGroupSamples {
public final class AccountsListSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_ListBySubscription.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_ListBySubscription.json
*/
/**
* Sample code: Accounts_ListBySubscription.
Expand All @@ -141,8 +230,8 @@ public final class AccountsListSamples {
public final class AccountsListByResourceGroupSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_ListByResourceGroup.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_ListByResourceGroup.json
*/
/**
* Sample code: Accounts_ListByResourceGroup.
Expand Down Expand Up @@ -171,8 +260,8 @@ import java.util.Map;
public final class AccountsUpdateSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Accounts_Update.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Accounts_Update.json
*/
/**
* Sample code: Accounts_Update.
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,8 +301,8 @@ public final class AccountsUpdateSamples {
public final class OperationsListSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Operations_List.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Operations_List.json
*/
/**
* Sample code: Operations_List.
Expand All @@ -235,8 +326,8 @@ import com.azure.resourcemanager.playwrighttesting.models.QuotaNames;
public final class QuotasGetSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Quotas_Get.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Quotas_Get.json
*/
/**
* Sample code: Quotas_Get.
Expand All @@ -258,8 +349,8 @@ public final class QuotasGetSamples {
public final class QuotasListBySubscriptionSamples {
/*
* x-ms-original-file:
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/
* examples/Quotas_ListBySubscription.json
* specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/examples/
* Quotas_ListBySubscription.json
*/
/**
* Sample code: Quotas_ListBySubscription.
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-12-01.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down Expand Up @@ -46,6 +46,7 @@
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
<revapi.skip>true</revapi.skip>
<spotless.skip>false</spotless.skip>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
Expand All @@ -19,15 +20,16 @@
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
import com.azure.core.management.profile.AzureProfile;
import com.azure.core.util.Configuration;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.playwrighttesting.fluent.PlaywrightTestingMgmtClient;
import com.azure.resourcemanager.playwrighttesting.implementation.AccountQuotasImpl;
import com.azure.resourcemanager.playwrighttesting.implementation.AccountsImpl;
import com.azure.resourcemanager.playwrighttesting.implementation.OperationsImpl;
import com.azure.resourcemanager.playwrighttesting.implementation.PlaywrightTestingMgmtClientBuilder;
import com.azure.resourcemanager.playwrighttesting.implementation.QuotasImpl;
import com.azure.resourcemanager.playwrighttesting.models.AccountQuotas;
import com.azure.resourcemanager.playwrighttesting.models.Accounts;
import com.azure.resourcemanager.playwrighttesting.models.Operations;
import com.azure.resourcemanager.playwrighttesting.models.Quotas;
Expand All @@ -49,6 +51,8 @@ public final class PlaywrightTestingManager {

private Quotas quotas;

private AccountQuotas accountQuotas;

private final PlaywrightTestingMgmtClient clientObject;

private PlaywrightTestingManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Expand Down Expand Up @@ -213,7 +217,7 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr
.append("-")
.append("com.azure.resourcemanager.playwrighttesting")
.append("/")
.append("1.0.0-beta.2");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder.append(" (")
.append(Configuration.getGlobalConfiguration().get("java.version"))
Expand Down Expand Up @@ -246,7 +250,7 @@ public PlaywrightTestingManager authenticate(TokenCredential credential, AzurePr
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
policies.add(new AddDatePolicy());
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.add(new BearerTokenAuthenticationPolicy(credential, scopes.toArray(new String[0])));
policies.addAll(this.policies.stream()
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
.collect(Collectors.toList()));
Expand Down Expand Up @@ -295,6 +299,18 @@ public Quotas quotas() {
return quotas;
}

/**
* Gets the resource collection API of AccountQuotas.
*
* @return Resource collection API of AccountQuotas.
*/
public AccountQuotas accountQuotas() {
if (this.accountQuotas == null) {
this.accountQuotas = new AccountQuotasImpl(clientObject.getAccountQuotas(), this);
}
return accountQuotas;
}

/**
* Gets wrapped service client PlaywrightTestingMgmtClient providing direct access to the underlying auto-generated
* API implementation, based on Azure REST API.
Expand Down
Loading