From 74157f1f2fa00ba4e45b0118324ef2b5f0afb612 Mon Sep 17 00:00:00 2001 From: MJ <71822730+mjmadhu@users.noreply.github.com> Date: Tue, 7 Jan 2025 16:34:50 +0530 Subject: [PATCH] Rectified a typo (#31855) --- .../AccessTokens_CreateOrReplace.json} | 8 +- .../2024-12-01/AccessTokens_Delete.json | 12 + .../2024-12-01/AccessTokens_Get.json} | 8 +- .../2024-12-01/AccessTokens_List.json} | 8 +- .../examples/2024-12-01/Accounts_Get.json} | 13 +- .../2024-12-01/Accounts_GetBrowsers.json | 16 + .../main.tsp | 125 ++- .../tspconfig.yaml | 44 + .../PlaywrightTesting.Management/main.tsp | 2 +- .../AccessTokens_DeleteAccessToken.json | 12 - .../PlaywrightTesting/tspconfig.yaml | 15 - .../AccessTokens_CreateOrReplace.json | 36 + .../examples/AccessTokens_Delete.json | 12 + .../2024-12-01/examples/AccessTokens_Get.json | 21 + .../examples/AccessTokens_List.json | 25 + .../2024-12-01/examples/Accounts_Get.json | 26 + .../examples/Accounts_GetBrowsers.json | 16 + .../stable/2024-12-01/playwrighttesting.json | 887 ++++++++++++++++++ .../playwrighttesting/data-plane/readme.md | 34 +- .../stable/2024-12-01/playwrighttesting.json | 4 +- 20 files changed, 1243 insertions(+), 81 deletions(-) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json} (80%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json} (69%) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json => PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json} (71%) rename specification/playwrighttesting/{PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json => PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json} (66%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json rename specification/playwrighttesting/{PlaywrightTesting => PlaywrightTesting.AuthManager}/main.tsp (51%) create mode 100644 specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml delete mode 100644 specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json delete mode 100644 specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json create mode 100644 specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json similarity index 80% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json index 17f6fd010929..3cda5ec2604c 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_CreateAccessToken.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_CreateOrReplace.json @@ -1,9 +1,9 @@ { - "title": "AccessTokens_CreateAccessToken", - "operationId": "AccessTokens_CreateAccessToken", + "title": "AccessTokens_CreateOrReplace", + "operationId": "AccessTokens_CreateOrReplace", "parameters": { - "api-version": "2023-10-01-preview", - "accountId": "sampleAccountId", + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000", "resource": { "id": "00000000-0000-0000-0000-000000000000", diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json new file mode 100644 index 000000000000..89786059c5bb --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "AccessTokens_Delete", + "operationId": "AccessTokens_Delete", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json similarity index 69% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json index b8669c51f92a..5bcc133167d2 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_GetAccessToken.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_Get.json @@ -1,9 +1,9 @@ { - "title": "AccessTokens_GetAccessToken", - "operationId": "AccessTokens_GetAccessToken", + "title": "AccessTokens_Get", + "operationId": "AccessTokens_Get", "parameters": { - "api-version": "2023-10-01-preview", - "accountId": "sampleAccountId", + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", "accessTokenId": "00000000-0000-0000-0000-000000000000" }, "responses": { diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json similarity index 71% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json index 01623f41f9f5..067ead9616f4 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_ListAccessTokens.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/AccessTokens_List.json @@ -1,9 +1,9 @@ { - "title": "AccessTokens_ListAccessTokens", - "operationId": "AccessTokens_ListAccessTokens", + "title": "AccessTokens_List", + "operationId": "AccessTokens_List", "parameters": { - "api-version": "2023-10-01-preview", - "accountId": "sampleAccountId" + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json similarity index 66% rename from specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json index e6a679938510..2305831119f2 100644 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/Accounts_GetAccount.json +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_Get.json @@ -1,14 +1,14 @@ { - "title": "Accounts_GetAccount", - "operationId": "Accounts_GetAccount", + "title": "Accounts_Get", + "operationId": "Accounts_Get", "parameters": { - "api-version": "2023-10-01-preview", - "accountId": "sampleAccountId" + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" }, "responses": { "200": { "body": { - "id": "sampleAccountId", + "id": "sampleAccountId_00000000-0000-0000-0000-000000000000", "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", "name": "myPlaywrightAccount", "state": "Active", @@ -18,7 +18,8 @@ "location": "westus", "regionalAffinity": "Enabled", "scalableExecution": "Enabled", - "reporting": "Disabled" + "reporting": "Disabled", + "localAuth": "Enabled" } } } diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json new file mode 100644 index 000000000000..c2e9c79dbbb3 --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/examples/2024-12-01/Accounts_GetBrowsers.json @@ -0,0 +1,16 @@ +{ + "title": "Accounts_GetBrowsers", + "operationId": "Accounts_GetBrowsers", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "os": "Linux" + }, + "responses": { + "302": { + "headers": { + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-12-01&os=linux" + } + } + } +} diff --git a/specification/playwrighttesting/PlaywrightTesting/main.tsp b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp similarity index 51% rename from specification/playwrighttesting/PlaywrightTesting/main.tsp rename to specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp index d5d85fca81f1..a70813099688 100644 --- a/specification/playwrighttesting/PlaywrightTesting/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/main.tsp @@ -5,26 +5,41 @@ import "@typespec/http"; import "@typespec/rest"; import "@typespec/versioning"; import "@azure-tools/typespec-azure-core"; -import "@azure-tools/typespec-autorest"; using TypeSpec.Http; using TypeSpec.Rest; using TypeSpec.Versioning; using Azure.Core; using Azure.Core.Traits; -using Autorest; @server( - "https://api.playwright-int.io", - "Azure Playwright Service API Endpoint" + "{endpoint}", + "Microsoft Azure Playwright Service API Endpoint", + { + @doc(""" + Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + https://{region}.api.playwright.microsoft.com). + """) + endpoint: string, + } ) @useAuth( [ OAuth2Auth<[ { type: OAuth2FlowType.implicit, + description: "We can use OAuth2 Implicit flow to get the auth token for calling the APIs.", authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", - scopes: ["https://preview.playwright-int.io/.default"], + scopes: ["https://playwright.microsoft.com/.default"], + } + ]>, + OAuth2Auth<[ + { + type: OAuth2FlowType.authorizationCode, + description: "We can use OAuth2 Authorization Code flow to get the auth token for calling the APIs.", + authorizationUrl: "https://login.microsoftonline.com/common/oauth2/authorize", + tokenUrl: "https://login.microsoftonline.com/common/v2.0/oauth2/token", + scopes: ["https://playwright.microsoft.com/.default"], } ]> ] @@ -37,22 +52,24 @@ namespace Microsoft.PlaywrightTesting.AuthManager; @doc("The PlaywrightTesting Auth Manager service version.") enum Versions { - @doc("Version 2023-10-01-preview") + @doc("Version 2024-12-01") @useDependency(Azure.Core.Versions.v1_0_Preview_2) - `2023-10-01-preview`, + `2024-12-01`, } // Models //////////////////// -@doc("An account is a parent resource for most of the other service resources. It's directly mapped to an ARM resource and helps to create a link between control-plane and data-plane resources.") +@doc("An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource.") @resource("accounts") model Account { @key("accountId") @doc("The account id.") + @maxLength(64) + @pattern("[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+") @visibility("read") id: string; - @doc("The ARM fully-qualified resource id for the account.") + @doc("The fully-qualified Azure resource id for the account.") @visibility("read") resourceId: string; @@ -64,11 +81,11 @@ model Account { @visibility("read") state: AccountState; - @doc("The ARM-based subscription id for the account.") + @doc("The Azure subscription id for the account.") @visibility("read") subscriptionId: uuid; - @doc("The ARM-based subscription state - Registered | Unregistered | Warned | Suspended | Deleted") + @doc("The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted") @visibility("read") subscriptionState: SubscriptionState; @@ -76,7 +93,7 @@ model Account { @visibility("read") tenantId: uuid; - @doc("The account resource ARM location, for eg. eastus, southeastasia.") + @doc("The account resource location in Azure, for eg. eastus, southeastasia.") @visibility("read") location: string; @@ -90,7 +107,11 @@ model Account { @doc("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.") @visibility("read") - reporting?: EnablementStatus = EnablementStatus.Disabled; + reporting?: EnablementStatus = EnablementStatus.Enabled; + + @doc("When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.") + @visibility("read") + localAuth?: EnablementStatus = EnablementStatus.Disabled; } @doc("The account state.") @@ -104,7 +125,7 @@ union AccountState { "Inactive", } -@doc("The ARM-based subscription state.") +@doc("The Azure subscription state.") union SubscriptionState { string, @@ -130,6 +151,8 @@ union SubscriptionState { model AccessToken { @key("accessTokenId") @doc("The access-token id.") + @maxLength(64) + @pattern("[A-Za-z0-9]+(-[A-Za-z0-9]+)+") @visibility("read") id: uuid; @@ -146,7 +169,7 @@ model AccessToken { @doc("The access-token createdAt utcDateTime.") @visibility("read") - createdAt?: utcDateTime; + createdAt: utcDateTime; @doc("The access-token expiryAt utcDateTime.") @visibility("read", "create") @@ -154,7 +177,7 @@ model AccessToken { @doc("The access-token state - Active | Expired.") @visibility("read") - state?: AccessTokenState; + state: AccessTokenState; } @doc("The access-token state.") @@ -162,10 +185,10 @@ union AccessTokenState { string, @doc("The access-token is Active.") - "Active", + Active: "Active", @doc("The access-token is Expired.") - "Expired", + Expired: "Expired", } @doc("The enablement status of a feature.") @@ -179,6 +202,17 @@ union EnablementStatus { Disabled: "Disabled", } +@doc("The os to configure for remote test runs.") +union OS { + string, + + @doc("Linux OS.") + Linux: "Linux", + + @doc("Windows OS.") + Windows: "Windows", +} + // Operations //////////////////// alias ServiceTraits = NoRepeatableRequests & @@ -189,23 +223,54 @@ alias Operations = Azure.Core.ResourceOperations; interface AccessTokens { // AccessToken Operations + @doc("Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + createOrReplace is Operations.ResourceCreateOrReplace; - #suppress "@azure-tools/typespec-azure-core/use-standard-names" "Existing name" - @doc("Creates an access-token with given access-token id in guid format.") - createAccessToken is Operations.ResourceCreateOrReplace; + @doc("Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + get is Operations.ResourceRead; - @doc("Get an access-token for given access-token id in guid format.") - getAccessToken is Operations.ResourceRead; + @doc("Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.") + delete is Operations.ResourceDelete; - @doc("Revoke an access-token with given access-token id in guid format.") - deleteAccessToken is Operations.ResourceDelete; - - @doc("List access-tokens for a given accountId.") - listAccessTokens is Operations.ResourceList; + @doc("Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.") + list is Operations.ResourceList; } +alias GetBrowsersParams = { + @path + @doc("The account id.") + accountId: string; + + @query + @doc("The run id provided by client for corresponding remote test run.") + runId?: string; + + @query + @doc("The os provided by client for remote test runs.") + os?: OS = OS.Linux; +}; + +alias GetBrowsersResponse = { + @statusCode + _: 302; + + @header + @doc("The redirect target URL to run test on remote browsers.") + location: url; +}; + interface Accounts { // Accounts Operations - @doc("Get details of the ARM resource mapped to an account for the given accountId.") - getAccount is Operations.ResourceRead; + + @doc("Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.") + get is Operations.ResourceRead; + + #suppress "@azure-tools/typespec-azure-core/no-rpc-path-params" "Operations defined using RpcOperation should not have path parameters. Consider using ResourceAction or ResourceCollectionAction instead." + @doc("Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service.") + @route("/accounts/{accountId}/browsers") + getBrowsers is RpcOperation< + GetBrowsersParams, + GetBrowsersResponse, + ServiceTraits + >; } diff --git a/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml new file mode 100644 index 000000000000..5b3209eec885 --- /dev/null +++ b/specification/playwrighttesting/PlaywrightTesting.AuthManager/tspconfig.yaml @@ -0,0 +1,44 @@ +emit: + - "@azure-tools/typespec-autorest" +linter: + extends: + - "@azure-tools/typespec-azure-rulesets/data-plane" +parameters: + "service-dir": + default: "sdk/playwrighttesting" +options: + "@azure-tools/typespec-autorest": + azure-resource-provider-folder: "data-plane" + emitter-output-dir: "{project-root}/.." + output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" + omit-unreachable-types: true + "@azure-tools/typespec-python": + package-dir: "azure-developer-microsoftplaywrighttesting" + package-name: "{package-dir}" + # emitter-output-dir: "{python-sdk-folder}/sdk/{service-directory-name}/{package-name}" + package-mode: azure-dataplane + flavor: azure + "@azure-tools/typespec-ts": + package-dir: "microsoft-playwright-testing-rest" + title: Microsoft Playwright Testing + description: Microsoft Playwright Testing Client + generateMetadata: true + generateTest: false + packageDetails: + name: "@azure-rest/microsoft-playwright-testing" + description: "This package contains Microsoft Playwright Testing client library." + version: 1.0.0 + flavor: azure + "@azure-tools/typespec-csharp": + package-dir: "Azure.Developer.MicrosoftPlaywrightTesting" + clear-output-folder: true + model-namespace: false + namespace: "{package-dir}" + flavor: azure + "@azure-tools/typespec-java": + package-dir: "azure-developer-microsoftplaywrighttesting" + namespace: com.azure.developer.microsoftplaywrighttesting + partial-update: true + generate-tests: false + service-name: Microsoft Playwright Testing + flavor: azure diff --git a/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp b/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp index 6f1579272e50..6583cebc20b5 100644 --- a/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp +++ b/specification/playwrighttesting/PlaywrightTesting.Management/main.tsp @@ -55,7 +55,7 @@ model AccountProperties { @doc("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.") reporting?: EnablementStatus = EnablementStatus.Enabled; - @doc("When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs.") + @doc("When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.") localAuth?: EnablementStatus = EnablementStatus.Disabled; @visibility("read") diff --git a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json b/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json deleted file mode 100644 index 1dfb8f32a21e..000000000000 --- a/specification/playwrighttesting/PlaywrightTesting/examples/2023-10-01-preview/AccessTokens_DeleteAccessToken.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "title": "AccessTokens_DeleteAccessToken", - "operationId": "AccessTokens_DeleteAccessToken", - "parameters": { - "api-version": "2023-10-01-preview", - "accountId": "sampleAccountId", - "accessTokenId": "00000000-0000-0000-0000-000000000000" - }, - "responses": { - "204": {} - } -} diff --git a/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml b/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml deleted file mode 100644 index d0d4ffa73239..000000000000 --- a/specification/playwrighttesting/PlaywrightTesting/tspconfig.yaml +++ /dev/null @@ -1,15 +0,0 @@ -emit: - - "@azure-tools/typespec-autorest" -linter: - extends: - - "@azure-tools/typespec-azure-rulesets/data-plane" -parameters: - "service-directory-name": - default: "playwrighttesting" -options: - "@azure-tools/typespec-autorest": - azure-resource-provider-folder: "data-plane" - emit-lro-options: "none" - emitter-output-dir: "{project-root}/.." - output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/playwrighttesting.json" - omit-unreachable-types: true diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json new file mode 100644 index 000000000000..3cda5ec2604c --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_CreateOrReplace.json @@ -0,0 +1,36 @@ +{ + "title": "AccessTokens_CreateOrReplace", + "operationId": "AccessTokens_CreateOrReplace", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "accessTokenId": "00000000-0000-0000-0000-000000000000", + "resource": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "expiryAt": "2022-09-28T12:32:33Z" + } + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + }, + "201": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json new file mode 100644 index 000000000000..89786059c5bb --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Delete.json @@ -0,0 +1,12 @@ +{ + "title": "AccessTokens_Delete", + "operationId": "AccessTokens_Delete", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "204": {} + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json new file mode 100644 index 000000000000..5bcc133167d2 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_Get.json @@ -0,0 +1,21 @@ +{ + "title": "AccessTokens_Get", + "operationId": "AccessTokens_Get", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "accessTokenId": "00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json new file mode 100644 index 000000000000..067ead9616f4 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/AccessTokens_List.json @@ -0,0 +1,25 @@ +{ + "title": "AccessTokens_List", + "operationId": "AccessTokens_List", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "00000000-0000-0000-0000-000000000000", + "name": "sampleAccessToken", + "jwtToken": "sampleJwtToken", + "createdAt": "2021-09-28T12:32:33Z", + "expiryAt": "2022-09-28T12:32:33Z", + "state": "Active" + } + ], + "nextLink": null + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json new file mode 100644 index 000000000000..2305831119f2 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_Get.json @@ -0,0 +1,26 @@ +{ + "title": "Accounts_Get", + "operationId": "Accounts_Get", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000" + }, + "responses": { + "200": { + "body": { + "id": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/dummyrg/providers/Microsoft.AzurePlaywrightService/accounts/myPlaywrightAccount", + "name": "myPlaywrightAccount", + "state": "Active", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "subscriptionState": "Registered", + "tenantId": "00000000-0000-0000-0000-000000000000", + "location": "westus", + "regionalAffinity": "Enabled", + "scalableExecution": "Enabled", + "reporting": "Disabled", + "localAuth": "Enabled" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json new file mode 100644 index 000000000000..c2e9c79dbbb3 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/examples/Accounts_GetBrowsers.json @@ -0,0 +1,16 @@ +{ + "title": "Accounts_GetBrowsers", + "operationId": "Accounts_GetBrowsers", + "parameters": { + "api-version": "2024-12-01", + "accountId": "sampleAccountId_00000000-0000-0000-0000-000000000000", + "os": "Linux" + }, + "responses": { + "302": { + "headers": { + "location": "wss://{region}.api.playwright.microsoft.com/redirectURL?api-version=2024-12-01&os=linux" + } + } + } +} diff --git a/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json new file mode 100644 index 000000000000..450c73579f07 --- /dev/null +++ b/specification/playwrighttesting/data-plane/Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json @@ -0,0 +1,887 @@ +{ + "swagger": "2.0", + "info": { + "title": "Microsoft PlaywrightTesting AuthManager Service API", + "version": "2024-12-01", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Azure Playwright Service API Endpoints (protocol and hostname, for example:\n https://{region}.api.playwright.microsoft.com).", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "OAuth2Auth": [ + "https://playwright.microsoft.com/.default" + ] + } + ], + "securityDefinitions": { + "OAuth2Auth": { + "type": "oauth2", + "flow": "accessCode", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "scopes": { + "https://playwright.microsoft.com/.default": "" + }, + "tokenUrl": "https://login.microsoftonline.com/common/v2.0/oauth2/token" + } + }, + "tags": [], + "paths": { + "/accounts/{accountId}": { + "get": { + "operationId": "Accounts_Get", + "description": "Get details of the Azure resource mapped to an account for the given account id. Authorization required is Bearer JWT Access token provided by EntraID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Account" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Accounts_Get": { + "$ref": "./examples/Accounts_Get.json" + } + } + } + }, + "/accounts/{accountId}/access-tokens": { + "get": { + "operationId": "AccessTokens_List", + "description": "Lists access-tokens for the given account id. It can use OData query params like $select, $filter, $orderby, $top and $skip. The default page size is 10. Use nextLink in response to fetch more objects in the list. Authorization required is Bearer JWT Access token provided by EntraID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedAccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_List": { + "$ref": "./examples/AccessTokens_List.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/accounts/{accountId}/access-tokens/{accessTokenId}": { + "get": { + "operationId": "AccessTokens_Get", + "description": "Gets an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_Get": { + "$ref": "./examples/AccessTokens_Get.json" + } + } + }, + "put": { + "operationId": "AccessTokens_CreateOrReplace", + "description": "Creates an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + }, + { + "name": "resource", + "in": "body", + "description": "The resource instance.", + "required": true, + "schema": { + "$ref": "#/definitions/AccessToken" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/AccessToken" + }, + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_CreateOrReplace": { + "$ref": "./examples/AccessTokens_CreateOrReplace.json" + } + } + }, + "delete": { + "operationId": "AccessTokens_Delete", + "description": "Deletes an access-token for the account with given access-token id. Authorization required is Bearer JWT Access token provided by EntraID.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+" + }, + { + "name": "accessTokenId", + "in": "path", + "description": "The access-token id.", + "required": true, + "type": "string", + "format": "uuid", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+" + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "204": { + "description": "There is no content to send for this request, but the headers may be useful. ", + "headers": { + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "AccessTokens_Delete": { + "$ref": "./examples/AccessTokens_Delete.json" + } + } + } + }, + "/accounts/{accountId}/browsers": { + "get": { + "operationId": "Accounts_GetBrowsers", + "description": "Gets remote browsers corresponding to given account id and redirects the client for running Playwright tests. Authorization required is Bearer JWT Access token provided by EntraID or Microsoft Playwright Testing Service.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "accountId", + "in": "path", + "description": "The account id.", + "required": true, + "type": "string" + }, + { + "name": "runId", + "in": "query", + "description": "The run id provided by client for corresponding remote test run.", + "required": false, + "type": "string" + }, + { + "name": "os", + "in": "query", + "description": "The os provided by client for remote test runs.", + "required": false, + "type": "string", + "default": "Linux", + "enum": [ + "Linux", + "Windows" + ], + "x-ms-enum": { + "name": "OS", + "modelAsString": true, + "values": [ + { + "name": "Linux", + "value": "Linux", + "description": "Linux OS." + }, + { + "name": "Windows", + "value": "Windows", + "description": "Windows OS." + } + ] + } + }, + { + "$ref": "#/parameters/Azure.Core.ClientRequestIdHeader" + } + ], + "responses": { + "302": { + "description": "Redirection", + "headers": { + "location": { + "type": "string", + "format": "uri", + "description": "The redirect target URL to run test on remote browsers." + }, + "x-ms-client-request-id": { + "type": "string", + "format": "uuid", + "description": "An opaque, globally-unique, client-generated string identifier for the request." + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Accounts_GetBrowsers": { + "$ref": "./examples/Accounts_GetBrowsers.json" + } + } + } + } + }, + "definitions": { + "AccessToken": { + "type": "object", + "description": "Model of an access-token linked to an account.", + "properties": { + "id": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The access-token id.", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(-[A-Za-z0-9]+)+", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The access-token name.", + "minLength": 3, + "maxLength": 64, + "pattern": "^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "jwtToken": { + "type": "string", + "description": "The access-token value in JWT format.", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The access-token createdAt utcDateTime.", + "readOnly": true + }, + "expiryAt": { + "type": "string", + "format": "date-time", + "description": "The access-token expiryAt utcDateTime.", + "x-ms-mutability": [ + "read", + "create" + ] + }, + "state": { + "$ref": "#/definitions/AccessTokenState", + "description": "The access-token state - Active | Expired.", + "readOnly": true + } + }, + "required": [ + "id", + "name", + "createdAt", + "expiryAt", + "state" + ] + }, + "AccessTokenState": { + "type": "string", + "description": "The access-token state.", + "enum": [ + "Active", + "Expired" + ], + "x-ms-enum": { + "name": "AccessTokenState", + "modelAsString": true, + "values": [ + { + "name": "Active", + "value": "Active", + "description": "The access-token is Active." + }, + { + "name": "Expired", + "value": "Expired", + "description": "The access-token is Expired." + } + ] + } + }, + "Account": { + "type": "object", + "description": "An account is a parent resource for most of the other service resources. It's directly mapped to an Azure resource.", + "properties": { + "id": { + "type": "string", + "description": "The account id.", + "maxLength": 64, + "pattern": "[A-Za-z0-9]+(_[A-Za-z0-9]+)*(-[A-Za-z0-9]+)+", + "readOnly": true + }, + "resourceId": { + "type": "string", + "description": "The fully-qualified Azure resource id for the account.", + "readOnly": true + }, + "name": { + "type": "string", + "description": "The account name.", + "readOnly": true + }, + "state": { + "$ref": "#/definitions/AccountState", + "description": "The state of account - Active | Inactive", + "readOnly": true + }, + "subscriptionId": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The Azure subscription id for the account.", + "readOnly": true + }, + "subscriptionState": { + "$ref": "#/definitions/SubscriptionState", + "description": "The Azure subscription state - Registered | Unregistered | Warned | Suspended | Deleted", + "readOnly": true + }, + "tenantId": { + "$ref": "#/definitions/Azure.Core.uuid", + "description": "The Azure tenant id of the account.", + "readOnly": true + }, + "location": { + "type": "string", + "description": "The account resource location in Azure, for eg. eastus, southeastasia.", + "readOnly": true + }, + "regionalAffinity": { + "type": "string", + "description": "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.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "scalableExecution": { + "type": "string", + "description": "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.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "reporting": { + "type": "string", + "description": "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.", + "default": "Enabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + }, + "localAuth": { + "type": "string", + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", + "default": "Disabled", + "enum": [ + "Enabled", + "Disabled" + ], + "x-ms-enum": { + "name": "EnablementStatus", + "modelAsString": true, + "values": [ + { + "name": "Enabled", + "value": "Enabled", + "description": "The feature is Enabled." + }, + { + "name": "Disabled", + "value": "Disabled", + "description": "The feature is Disabled." + } + ] + }, + "readOnly": true + } + }, + "required": [ + "id", + "resourceId", + "name", + "state", + "subscriptionId", + "subscriptionState", + "tenantId", + "location" + ] + }, + "AccountState": { + "type": "string", + "description": "The account state.", + "enum": [ + "Active", + "Inactive" + ], + "x-ms-enum": { + "name": "AccountState", + "modelAsString": true, + "values": [ + { + "name": "Active", + "value": "Active", + "description": "The account is Active." + }, + { + "name": "Inactive", + "value": "Inactive", + "description": "The account is Inactive." + } + ] + } + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + }, + "x-ms-identifiers": [] + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Microsoft One API guidelines - https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "Azure.Core.uuid": { + "type": "string", + "format": "uuid", + "description": "Universally Unique Identifier" + }, + "PagedAccessToken": { + "type": "object", + "description": "Paged collection of AccessToken items", + "properties": { + "value": { + "type": "array", + "description": "The AccessToken items on this page", + "items": { + "$ref": "#/definitions/AccessToken" + } + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "SubscriptionState": { + "type": "string", + "description": "The Azure subscription state.", + "enum": [ + "Registered", + "Warned", + "Suspended", + "Deleted", + "Unregistered" + ], + "x-ms-enum": { + "name": "SubscriptionState", + "modelAsString": true, + "values": [ + { + "name": "Registered", + "value": "Registered", + "description": "The subscription state is Registered." + }, + { + "name": "Warned", + "value": "Warned", + "description": "The subscription state is Warned." + }, + { + "name": "Suspended", + "value": "Suspended", + "description": "The subscription state is Suspended." + }, + { + "name": "Deleted", + "value": "Deleted", + "description": "The subscription state is Deleted." + }, + { + "name": "Unregistered", + "value": "Unregistered", + "description": "The subscription state is Unregistered." + } + ] + } + } + }, + "parameters": { + "Azure.Core.ClientRequestIdHeader": { + "name": "x-ms-client-request-id", + "in": "header", + "description": "An opaque, globally-unique, client-generated string identifier for the request.", + "required": false, + "type": "string", + "format": "uuid", + "x-ms-parameter-location": "method", + "x-ms-client-name": "clientRequestId" + }, + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + } + } +} diff --git a/specification/playwrighttesting/data-plane/readme.md b/specification/playwrighttesting/data-plane/readme.md index 75117f82cfde..f45a484c1af7 100644 --- a/specification/playwrighttesting/data-plane/readme.md +++ b/specification/playwrighttesting/data-plane/readme.md @@ -26,10 +26,38 @@ These are the global settings for the playwrighttesting. ```yaml openapi-type: data-plane -tag: package-2023-10-01-preview -title: [[Title]] +tag: package-2024-12-01 +title: PlaywrightTestingClient security: AADToken -security-scopes: [[SecurityScopes]] +#security-scopes: [[SecurityScopes]] +``` + +### Tag: package-2024-12-01 + +These settings apply only when `--tag=package-2024-12-01` is specified on the command line. + +```yaml $(tag) == 'package-2024-12-01' +input-file: + - Microsoft.PlaywrightTesting.AuthManager/stable/2024-12-01/playwrighttesting.json +suppressions: + - code: ValidResponseCodeRequired + from: playwrighttesting.json + reason: Need 302 response code as a product requirement to redirect the client for test execution on remote browsers provided by the service. + where: + - $.paths["/accounts/{accountId}/browsers"].get.responses + - code: SecurityDefinitionDescription + from: playwrighttesting.json + reason: Seems like a tool bug, as the description is added in the TypeSpec already. + - code: PathParameterSchema + from: playwrighttesting.json + reason: No provision to define path parameter schema for custom routes of rpc operations in Typespec. + where: + - $.paths["/accounts/{accountId}/browsers"].get.parameters[1] + - code: OperationId + from: playwrighttesting.json + reason: Inconsistency with Typespec nomenclature to use create and replace for put while update is used for patch api. + where: + - $.paths["/accounts/{accountId}/access-tokens/{accessTokenId}"].put.operationId ``` ### Tag: package-2023-10-01-preview diff --git a/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json b/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json index dd5351642022..0321c9944190 100644 --- a/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json +++ b/specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/stable/2024-12-01/playwrighttesting.json @@ -870,7 +870,7 @@ }, "localAuth": { "type": "string", - "description": "When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs.", + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations.", "default": "Disabled", "enum": [ "Enabled", @@ -988,7 +988,7 @@ }, "localAuth": { "$ref": "#/definitions/EnablementStatus", - "description": "When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs." + "description": "When enabled, this feature allows the workspace to use local auth (through service access token) for executing operations." } } },