diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 944aa0bf429e..c70d8b615cca 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -13847,7 +13847,7 @@ packages: dev: false file:projects/arm-datafactory.tgz: - resolution: {integrity: sha512-Q/UgF/jHUhFWs4a2VHg5BPu4EacOjaoAJqlLqGFX3ZwG0GZDoRx8FtqHRw8p4jzKB5vuOrEV/3GzXjtsgu1WWg==, tarball: file:projects/arm-datafactory.tgz} + resolution: {integrity: sha512-OjurQ7/SHnCoMLxEpSFGvaVMi0A2ZKFX6rJ/jwbdMCikCifxpU7FWz3q7qpsBMKSUwwPiN6m0entDZOQ2Ya3DQ==, tarball: file:projects/arm-datafactory.tgz} name: '@rush-temp/arm-datafactory' version: 0.0.0 dependencies: @@ -16907,7 +16907,7 @@ packages: dev: false file:projects/arm-playwrighttesting.tgz: - resolution: {integrity: sha512-SfLw2iA6ejViaiilnys6IsWVuaPcxRdPu+pIscYCeijd0HwMZJorXtc1eTFZ7SIn8PuDmGXXzHliIqsJxl4UsQ==, tarball: file:projects/arm-playwrighttesting.tgz} + resolution: {integrity: sha512-H2UaajAlCTe8PuWzTbJMbXWSphjbsGyYoa4y4KEDzIP2S092hBOcR7qhIdxWEZZdpP01okkuuw4KSpHqaG/67Q==, tarball: file:projects/arm-playwrighttesting.tgz} name: '@rush-temp/arm-playwrighttesting' version: 0.0.0 dependencies: @@ -16928,6 +16928,7 @@ packages: rimraf: 5.0.10 ts-node: 10.9.2(@types/node@18.19.46)(typescript@5.5.4) tslib: 2.7.0 + tsx: 4.18.0 typescript: 5.5.4 uglify-js: 3.19.2 transitivePeerDependencies: @@ -17289,7 +17290,7 @@ packages: dev: false file:projects/arm-quota.tgz: - resolution: {integrity: sha512-xk059uR7eCCN3t024cWSE4S9muFzgPyN0kwgYPtQ9y/4+OQwdv8wvBqclcnw++X7ttxE5uPz9P6NgkNQS+HINA==, tarball: file:projects/arm-quota.tgz} + resolution: {integrity: sha512-DT26fngJRNaDs9vD1pNoxWWP94MBNU2psw6cuM97r8fzubsU/y5f2u9WsdMzNs5HZT5md5gTN8b8h6aG1M6/Yw==, tarball: file:projects/arm-quota.tgz} name: '@rush-temp/arm-quota' version: 0.0.0 dependencies: @@ -20371,7 +20372,7 @@ packages: dev: false file:projects/core-rest-pipeline.tgz: - resolution: {integrity: sha512-Ckt9WaQnIP5+x4m60yXQvQMFfFFmvIVzG5Y2cLKI/6XWnjD9mx5RfL20OpOmwGFT04KnyxWUZoVxalNLlieF8Q==, tarball: file:projects/core-rest-pipeline.tgz} + resolution: {integrity: sha512-Y89gCuNnHD3FSHtxVO2vCgGgCF27cFz7Hd+Xlmfgu5s/Fz8lm4IjZqOm165C2xjS7EWmWmrIEfXKwGfVQcZnBA==, tarball: file:projects/core-rest-pipeline.tgz} name: '@rush-temp/core-rest-pipeline' version: 0.0.0 dependencies: @@ -21561,7 +21562,7 @@ packages: dev: false file:projects/identity.tgz: - resolution: {integrity: sha512-sjF9+fskcd/8aI964QgNTcos2w8b0MgC0Zu5Vwn3xmjQtQjWMvPy3o85VZx6+vq4GFHOsou0tobu1krKLtvZJA==, tarball: file:projects/identity.tgz} + resolution: {integrity: sha512-5EkTlu2q3ZkjPIlIBMu4R++aneg//XjawueoiPtgIS2Be16wcAhkmossUcKDv1whl1evCy79PC5drQIvn1Yi6Q==, tarball: file:projects/identity.tgz} name: '@rush-temp/identity' version: 0.0.0 dependencies: diff --git a/sdk/playwrighttesting/arm-playwrighttesting/CHANGELOG.md b/sdk/playwrighttesting/arm-playwrighttesting/CHANGELOG.md index e9499e95450d..99223fbc6c00 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/CHANGELOG.md +++ b/sdk/playwrighttesting/arm-playwrighttesting/CHANGELOG.md @@ -1,18 +1,51 @@ # Release History - -## 1.0.0-beta.3 (Unreleased) - + +## 1.0.0-beta.3 (2024-08-29) +Compared with version 1.0.0-beta.2 + ### Features Added -### Breaking Changes - -### Bugs Fixed + - Added operation group AccountQuotas + - Added operation Accounts.checkNameAvailability + - Added Interface AccountFreeTrialProperties + - Added Interface AccountQuota + - Added Interface AccountQuotaListResult + - Added Interface AccountQuotaProperties + - Added Interface AccountQuotasGetOptionalParams + - Added Interface AccountQuotasListByAccountNextOptionalParams + - Added Interface AccountQuotasListByAccountOptionalParams + - Added Interface AccountsCheckNameAvailabilityOptionalParams + - Added Interface CheckNameAvailabilityRequest + - Added Interface CheckNameAvailabilityResponse + - Added Type Alias AccountQuotasGetResponse + - Added Type Alias AccountQuotasListByAccountNextResponse + - Added Type Alias AccountQuotasListByAccountResponse + - Added Type Alias AccountsCheckNameAvailabilityResponse + - Added Type Alias AccountsDeleteResponse + - Added Type Alias CheckNameAvailabilityReason + - Added Type Alias OfferingType + - Interface AccountProperties has a new optional parameter localAuth + - Interface AccountUpdateProperties has a new optional parameter localAuth + - Interface QuotaProperties has a new optional parameter offeringType + - Added Enum KnownCheckNameAvailabilityReason + - Added Enum KnownOfferingType + - Enum KnownFreeTrialState has a new value NotEligible + - Enum KnownFreeTrialState has a new value NotRegistered + - Enum KnownProvisioningState has a new value Creating + - Enum KnownQuotaNames has a new value Reporting -### Other Changes +### Breaking Changes + - Interface FreeTrialProperties no longer has parameter allocatedValue + - Interface FreeTrialProperties no longer has parameter createdAt + - Interface FreeTrialProperties no longer has parameter expiryAt + - Interface FreeTrialProperties no longer has parameter percentageUsed + - Interface FreeTrialProperties no longer has parameter usedValue + + ## 1.0.0-beta.2 (2024-01-31) -**Features** +### Features Added - Added Interface AccountProperties - Added Interface AccountUpdateProperties @@ -21,7 +54,7 @@ - Interface AccountUpdate has a new optional parameter properties - Interface Quota has a new optional parameter properties -**Breaking Changes** +### Breaking Changes - Interface Account no longer has parameter dashboardUri - Interface Account no longer has parameter provisioningState diff --git a/sdk/playwrighttesting/arm-playwrighttesting/_meta.json b/sdk/playwrighttesting/arm-playwrighttesting/_meta.json index c11d1254f9e7..371533fbce07 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/_meta.json +++ b/sdk/playwrighttesting/arm-playwrighttesting/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f3cd6922dbe117d78b4f719bbf8b03db46b30808", + "commit": "da24b5849c0807745bf21574317bf73805d4dff1", "readme": "specification/playwrighttesting/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\playwrighttesting\\resource-manager\\readme.md --use=@autorest/typescript@6.0.13 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/playwrighttesting/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", - "use": "@autorest/typescript@6.0.13" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.11", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/playwrighttesting/arm-playwrighttesting/assets.json b/sdk/playwrighttesting/arm-playwrighttesting/assets.json deleted file mode 100644 index 75595f52e0af..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/playwrighttesting/arm-playwrighttesting", - "Tag": "js/playwrighttesting/arm-playwrighttesting_4638cdcb91" -} diff --git a/sdk/playwrighttesting/arm-playwrighttesting/package.json b/sdk/playwrighttesting/arm-playwrighttesting/package.json index 2d3f5dc79e43..cb3f487a5c77 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/package.json +++ b/sdk/playwrighttesting/arm-playwrighttesting/package.json @@ -9,11 +9,11 @@ }, "dependencies": { "@azure/core-lro": "^2.5.4", - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.12.0", + "@azure/core-auth": "^1.6.0", + "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, "keywords": [ @@ -35,11 +35,12 @@ "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", - "@azure/identity": "^4.0.1", + "@azure/identity": "^4.2.1", "@azure-tools/test-recorder": "^3.0.0", - "@azure-tools/test-credential": "^1.0.0", + "@azure-tools/test-credential": "^1.1.0", "mocha": "^10.0.0", "@types/mocha": "^10.0.0", + "tsx": "^4.7.1", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", @@ -77,7 +78,6 @@ "pack": "npm pack 2>&1", "extract-api": "dev-tool run extract-api", "lint": "echo skipped", - "audit": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", @@ -106,13 +106,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-playwrighttesting?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting" +} \ No newline at end of file diff --git a/sdk/playwrighttesting/arm-playwrighttesting/review/arm-playwrighttesting.api.md b/sdk/playwrighttesting/arm-playwrighttesting/review/arm-playwrighttesting.api.md index 0b21556485ab..f0bc941d76db 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/review/arm-playwrighttesting.api.md +++ b/sdk/playwrighttesting/arm-playwrighttesting/review/arm-playwrighttesting.api.md @@ -15,6 +15,15 @@ export interface Account extends TrackedResource { properties?: AccountProperties; } +// @public +export interface AccountFreeTrialProperties { + readonly allocatedValue: number; + readonly createdAt: Date; + readonly expiryAt: Date; + readonly percentageUsed: number; + readonly usedValue: number; +} + // @public export interface AccountListResult { nextLink?: string; @@ -24,24 +33,77 @@ export interface AccountListResult { // @public export interface AccountProperties { readonly dashboardUri?: string; + localAuth?: EnablementStatus; readonly provisioningState?: ProvisioningState; regionalAffinity?: EnablementStatus; reporting?: EnablementStatus; scalableExecution?: EnablementStatus; } +// @public +export interface AccountQuota extends ProxyResource { + properties?: AccountQuotaProperties; +} + +// @public +export interface AccountQuotaListResult { + nextLink?: string; + value: AccountQuota[]; +} + +// @public +export interface AccountQuotaProperties { + freeTrial?: AccountFreeTrialProperties; + readonly provisioningState?: ProvisioningState; +} + +// @public +export interface AccountQuotas { + get(resourceGroupName: string, accountName: string, quotaName: QuotaNames, options?: AccountQuotasGetOptionalParams): Promise; + listByAccount(resourceGroupName: string, accountName: string, options?: AccountQuotasListByAccountOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface AccountQuotasGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountQuotasGetResponse = AccountQuota; + +// @public +export interface AccountQuotasListByAccountNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountQuotasListByAccountNextResponse = AccountQuotaListResult; + +// @public +export interface AccountQuotasListByAccountOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountQuotasListByAccountResponse = AccountQuotaListResult; + // @public export interface Accounts { - beginCreateOrUpdate(resourceGroupName: string, name: string, resource: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise, AccountsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(resourceGroupName: string, name: string, resource: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, options?: AccountsDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, name: string, options?: AccountsDeleteOptionalParams): Promise; - get(resourceGroupName: string, name: string, options?: AccountsGetOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, accountName: string, resource: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise, AccountsCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, resource: Account, options?: AccountsCreateOrUpdateOptionalParams): Promise; + beginDelete(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise, AccountsDeleteResponse>>; + beginDeleteAndWait(resourceGroupName: string, accountName: string, options?: AccountsDeleteOptionalParams): Promise; + checkNameAvailability(body: CheckNameAvailabilityRequest, options?: AccountsCheckNameAvailabilityOptionalParams): Promise; + get(resourceGroupName: string, accountName: string, options?: AccountsGetOptionalParams): Promise; listByResourceGroup(resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: AccountsListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - update(resourceGroupName: string, name: string, properties: AccountUpdate, options?: AccountsUpdateOptionalParams): Promise; + update(resourceGroupName: string, accountName: string, properties: AccountUpdate, options?: AccountsUpdateOptionalParams): Promise; } +// @public +export interface AccountsCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type AccountsCheckNameAvailabilityResponse = CheckNameAvailabilityResponse; + // @public export interface AccountsCreateOrUpdateHeaders { retryAfter?: number; @@ -68,6 +130,9 @@ export interface AccountsDeleteOptionalParams extends coreClient.OperationOption updateIntervalInMs?: number; } +// @public +export type AccountsDeleteResponse = AccountsDeleteHeaders; + // @public export interface AccountsGetOptionalParams extends coreClient.OperationOptions { } @@ -120,6 +185,7 @@ export interface AccountUpdate { // @public export interface AccountUpdateProperties { + localAuth?: EnablementStatus; regionalAffinity?: EnablementStatus; reporting?: EnablementStatus; scalableExecution?: EnablementStatus; @@ -128,6 +194,22 @@ export interface AccountUpdateProperties { // @public export type ActionType = string; +// @public +export type CheckNameAvailabilityReason = string; + +// @public +export interface CheckNameAvailabilityRequest { + name?: string; + type?: string; +} + +// @public +export interface CheckNameAvailabilityResponse { + message?: string; + nameAvailable?: boolean; + reason?: CheckNameAvailabilityReason; +} + // @public export type CreatedByType = string; @@ -157,12 +239,7 @@ export interface ErrorResponse { // @public export interface FreeTrialProperties { readonly accountId: string; - readonly allocatedValue: number; - readonly createdAt: Date; - readonly expiryAt: Date; - readonly percentageUsed: number; readonly state: FreeTrialState; - readonly usedValue: number; } // @public @@ -176,6 +253,12 @@ export enum KnownActionType { Internal = "Internal" } +// @public +export enum KnownCheckNameAvailabilityReason { + AlreadyExists = "AlreadyExists", + Invalid = "Invalid" +} + // @public export enum KnownCreatedByType { Application = "Application", @@ -193,7 +276,17 @@ export enum KnownEnablementStatus { // @public export enum KnownFreeTrialState { Active = "Active", - Expired = "Expired" + Expired = "Expired", + NotEligible = "NotEligible", + NotRegistered = "NotRegistered" +} + +// @public +export enum KnownOfferingType { + GeneralAvailability = "GeneralAvailability", + NotApplicable = "NotApplicable", + PrivatePreview = "PrivatePreview", + PublicPreview = "PublicPreview" } // @public @@ -207,6 +300,7 @@ export enum KnownOrigin { export enum KnownProvisioningState { Accepted = "Accepted", Canceled = "Canceled", + Creating = "Creating", Deleting = "Deleting", Failed = "Failed", Succeeded = "Succeeded" @@ -214,9 +308,13 @@ export enum KnownProvisioningState { // @public export enum KnownQuotaNames { + Reporting = "Reporting", ScalableExecution = "ScalableExecution" } +// @public +export type OfferingType = string; + // @public export interface Operation { readonly actionType?: ActionType; @@ -268,6 +366,8 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { $host: string; constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: PlaywrightTestingClientOptionalParams); // (undocumented) + accountQuotas: AccountQuotas; + // (undocumented) accounts: Accounts; // (undocumented) apiVersion: string; @@ -310,12 +410,13 @@ export type QuotaNames = string; // @public export interface QuotaProperties { freeTrial?: FreeTrialProperties; + readonly offeringType?: OfferingType; readonly provisioningState?: ProvisioningState; } // @public export interface Quotas { - get(location: string, name: QuotaNames, options?: QuotasGetOptionalParams): Promise; + get(location: string, quotaName: QuotaNames, options?: QuotasGetOptionalParams): Promise; listBySubscription(location: string, options?: QuotasListBySubscriptionOptionalParams): PagedAsyncIterableIterator; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsCreateOrUpdateSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsCreateOrUpdateSample.ts deleted file mode 100644 index 99e43ee54ee0..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Account, PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Account - * - * @summary Create a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json - */ -async function accountsCreateOrUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const resource: Account = { - location: "westus", - properties: { regionalAffinity: "Enabled" }, - tags: { team: "Dev Exp" } - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginCreateOrUpdateAndWait( - resourceGroupName, - name, - resource - ); - console.log(result); -} - -async function main() { - accountsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsDeleteSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsDeleteSample.ts deleted file mode 100644 index 8ffc41ea3061..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Account - * - * @summary Delete a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json - */ -async function accountsDelete() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginDeleteAndWait( - resourceGroupName, - name - ); - console.log(result); -} - -async function main() { - accountsDelete(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsGetSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsGetSample.ts deleted file mode 100644 index b861ded65f35..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Account - * - * @summary Get a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - */ -async function accountsGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.get(resourceGroupName, name); - console.log(result); -} - -async function main() { - accountsGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListByResourceGroupSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListByResourceGroupSample.ts deleted file mode 100644 index 9b5b26e2a371..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Account resources by resource group - * - * @summary List Account resources by resource group - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json - */ -async function accountsListByResourceGroup() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListBySubscriptionSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListBySubscriptionSample.ts deleted file mode 100644 index 333806a6c07b..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Account resources by subscription ID - * - * @summary List Account resources by subscription ID - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json - */ -async function accountsListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsUpdateSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsUpdateSample.ts deleted file mode 100644 index 558728376361..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/accountsUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccountUpdate, - PlaywrightTestingClient -} from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Account - * - * @summary Update a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json - */ -async function accountsUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const properties: AccountUpdate = { - properties: { regionalAffinity: "Enabled" }, - tags: { division: "LT", team: "Dev Exp" } - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.update( - resourceGroupName, - name, - properties - ); - console.log(result); -} - -async function main() { - accountsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/operationsListSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/operationsListSample.ts deleted file mode 100644 index a7d239bca8d2..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasGetSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasGetSample.ts deleted file mode 100644 index 2656f6a7ff3b..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get quota by name. - * - * @summary Get quota by name. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - */ -async function quotasGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const name = "ScalableExecution"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.quotas.get(location, name); - console.log(result); -} - -async function main() { - quotasGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasListBySubscriptionSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasListBySubscriptionSample.ts deleted file mode 100644 index eb0c566fd45c..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples-dev/quotasListBySubscriptionSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List quotas for a given subscription Id. - * - * @summary List quotas for a given subscription Id. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json - */ -async function quotasListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.quotas.listBySubscription(location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - quotasListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/README.md b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/README.md deleted file mode 100644 index ec0c698bd1a9..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountsCreateOrUpdateSample.js][accountscreateorupdatesample] | Create a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json | -| [accountsDeleteSample.js][accountsdeletesample] | Delete a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json | -| [accountsGetSample.js][accountsgetsample] | Get a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json | -| [accountsListByResourceGroupSample.js][accountslistbyresourcegroupsample] | List Account resources by resource group x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json | -| [accountsListBySubscriptionSample.js][accountslistbysubscriptionsample] | List Account resources by subscription ID x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json | -| [accountsUpdateSample.js][accountsupdatesample] | Update a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json | -| [quotasGetSample.js][quotasgetsample] | Get quota by name. x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json | -| [quotasListBySubscriptionSample.js][quotaslistbysubscriptionsample] | List quotas for a given subscription Id. x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node accountsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env PLAYWRIGHTTESTING_SUBSCRIPTION_ID="" PLAYWRIGHTTESTING_RESOURCE_GROUP="" node accountsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsCreateOrUpdateSample.js -[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsDeleteSample.js -[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsGetSample.js -[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListByResourceGroupSample.js -[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListBySubscriptionSample.js -[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsUpdateSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/operationsListSample.js -[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasGetSample.js -[quotaslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasListBySubscriptionSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-playwrighttesting?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting/README.md diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsCreateOrUpdateSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsCreateOrUpdateSample.js deleted file mode 100644 index 5fd51252cfe3..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Account - * - * @summary Create a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json - */ -async function accountsCreateOrUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const resource = { - location: "westus", - properties: { regionalAffinity: "Enabled" }, - tags: { team: "Dev Exp" }, - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginCreateOrUpdateAndWait( - resourceGroupName, - name, - resource, - ); - console.log(result); -} - -async function main() { - accountsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsDeleteSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsDeleteSample.js deleted file mode 100644 index efd6706fd78c..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Account - * - * @summary Delete a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json - */ -async function accountsDelete() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginDeleteAndWait(resourceGroupName, name); - console.log(result); -} - -async function main() { - accountsDelete(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsGetSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsGetSample.js deleted file mode 100644 index 912d54322f40..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Account - * - * @summary Get a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - */ -async function accountsGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.get(resourceGroupName, name); - console.log(result); -} - -async function main() { - accountsGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListByResourceGroupSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListByResourceGroupSample.js deleted file mode 100644 index cdf2895d2285..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Account resources by resource group - * - * @summary List Account resources by resource group - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json - */ -async function accountsListByResourceGroup() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListBySubscriptionSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListBySubscriptionSample.js deleted file mode 100644 index bf4ff79ffc3c..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Account resources by subscription ID - * - * @summary List Account resources by subscription ID - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json - */ -async function accountsListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsUpdateSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsUpdateSample.js deleted file mode 100644 index 0006112ba3b8..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/accountsUpdateSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Account - * - * @summary Update a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json - */ -async function accountsUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const properties = { - properties: { regionalAffinity: "Enabled" }, - tags: { division: "LT", team: "Dev Exp" }, - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.update(resourceGroupName, name, properties); - console.log(result); -} - -async function main() { - accountsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/operationsListSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index abe53cad2326..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/package.json b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/package.json deleted file mode 100644 index 9140e33f9aa5..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-playwrighttesting-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/playwrighttesting/arm-playwrighttesting" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting", - "dependencies": { - "@azure/arm-playwrighttesting": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - } -} diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasGetSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasGetSample.js deleted file mode 100644 index 003b45762792..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get quota by name. - * - * @summary Get quota by name. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - */ -async function quotasGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const name = "ScalableExecution"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.quotas.get(location, name); - console.log(result); -} - -async function main() { - quotasGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasListBySubscriptionSample.js b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasListBySubscriptionSample.js deleted file mode 100644 index dd7b01544747..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/quotasListBySubscriptionSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { PlaywrightTestingClient } = require("@azure/arm-playwrighttesting"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List quotas for a given subscription Id. - * - * @summary List quotas for a given subscription Id. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json - */ -async function quotasListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.quotas.listBySubscription(location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - quotasListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/sample.env b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/README.md b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/README.md deleted file mode 100644 index bfca5a8486f4..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountsCreateOrUpdateSample.ts][accountscreateorupdatesample] | Create a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json | -| [accountsDeleteSample.ts][accountsdeletesample] | Delete a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json | -| [accountsGetSample.ts][accountsgetsample] | Get a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json | -| [accountsListByResourceGroupSample.ts][accountslistbyresourcegroupsample] | List Account resources by resource group x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json | -| [accountsListBySubscriptionSample.ts][accountslistbysubscriptionsample] | List Account resources by subscription ID x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json | -| [accountsUpdateSample.ts][accountsupdatesample] | Update a Account x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json | -| [quotasGetSample.ts][quotasgetsample] | Get quota by name. x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json | -| [quotasListBySubscriptionSample.ts][quotaslistbysubscriptionsample] | List quotas for a given subscription Id. x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/accountsCreateOrUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -npx cross-env PLAYWRIGHTTESTING_SUBSCRIPTION_ID="" PLAYWRIGHTTESTING_RESOURCE_GROUP="" node dist/accountsCreateOrUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accountscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsCreateOrUpdateSample.ts -[accountsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsDeleteSample.ts -[accountsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsGetSample.ts -[accountslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts -[accountslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts -[accountsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsUpdateSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/operationsListSample.ts -[quotasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasGetSample.ts -[quotaslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasListBySubscriptionSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-playwrighttesting?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/package.json b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/package.json deleted file mode 100644 index 829dfbcbfc46..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-playwrighttesting-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/playwrighttesting/arm-playwrighttesting" - }, - "keywords": [ - "node", - "azure", - "typescript", - "browser", - "isomorphic" - ], - "author": "Microsoft Corporation", - "license": "MIT", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/playwrighttesting/arm-playwrighttesting", - "dependencies": { - "@azure/arm-playwrighttesting": "next", - "dotenv": "latest", - "@azure/identity": "^4.2.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.5.3", - "rimraf": "latest" - } -} diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/sample.env b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsCreateOrUpdateSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsCreateOrUpdateSample.ts deleted file mode 100644 index 99e43ee54ee0..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsCreateOrUpdateSample.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Account, PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Account - * - * @summary Create a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_CreateOrUpdate.json - */ -async function accountsCreateOrUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const resource: Account = { - location: "westus", - properties: { regionalAffinity: "Enabled" }, - tags: { team: "Dev Exp" } - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginCreateOrUpdateAndWait( - resourceGroupName, - name, - resource - ); - console.log(result); -} - -async function main() { - accountsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsDeleteSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsDeleteSample.ts deleted file mode 100644 index 8ffc41ea3061..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsDeleteSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Account - * - * @summary Delete a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Delete.json - */ -async function accountsDelete() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.beginDeleteAndWait( - resourceGroupName, - name - ); - console.log(result); -} - -async function main() { - accountsDelete(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsGetSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsGetSample.ts deleted file mode 100644 index b861ded65f35..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsGetSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Account - * - * @summary Get a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Get.json - */ -async function accountsGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.get(resourceGroupName, name); - console.log(result); -} - -async function main() { - accountsGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts deleted file mode 100644 index 9b5b26e2a371..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Account resources by resource group - * - * @summary List Account resources by resource group - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListByResourceGroup.json - */ -async function accountsListByResourceGroup() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts deleted file mode 100644 index 333806a6c07b..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Account resources by subscription ID - * - * @summary List Account resources by subscription ID - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_ListBySubscription.json - */ -async function accountsListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accounts.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - accountsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsUpdateSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsUpdateSample.ts deleted file mode 100644 index 558728376361..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/accountsUpdateSample.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - AccountUpdate, - PlaywrightTestingClient -} from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Account - * - * @summary Update a Account - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Accounts_Update.json - */ -async function accountsUpdate() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["PLAYWRIGHTTESTING_RESOURCE_GROUP"] || "dummyrg"; - const name = "myPlaywrightAccount"; - const properties: AccountUpdate = { - properties: { regionalAffinity: "Enabled" }, - tags: { division: "LT", team: "Dev Exp" } - }; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.accounts.update( - resourceGroupName, - name, - properties - ); - console.log(result); -} - -async function main() { - accountsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index a7d239bca8d2..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Operations_List.json - */ -async function operationsList() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasGetSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasGetSample.ts deleted file mode 100644 index 2656f6a7ff3b..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasGetSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get quota by name. - * - * @summary Get quota by name. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_Get.json - */ -async function quotasGet() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const name = "ScalableExecution"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const result = await client.quotas.get(location, name); - console.log(result); -} - -async function main() { - quotasGet(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasListBySubscriptionSample.ts b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasListBySubscriptionSample.ts deleted file mode 100644 index eb0c566fd45c..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/src/quotasListBySubscriptionSample.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { PlaywrightTestingClient } from "@azure/arm-playwrighttesting"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List quotas for a given subscription Id. - * - * @summary List quotas for a given subscription Id. - * x-ms-original-file: specification/playwrighttesting/resource-manager/Microsoft.AzurePlaywrightService/preview/2023-10-01-preview/examples/Quotas_ListBySubscription.json - */ -async function quotasListBySubscription() { - const subscriptionId = - process.env["PLAYWRIGHTTESTING_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const location = "eastus"; - const credential = new DefaultAzureCredential(); - const client = new PlaywrightTestingClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.quotas.listBySubscription(location)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - quotasListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/tsconfig.json b/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa8..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "alwaysStrict": true, - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/lroImpl.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/lroImpl.ts index 52f6eaacfb83..b27f5ac7209b 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/lroImpl.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/lroImpl.ts @@ -7,7 +7,7 @@ */ // Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. +// Licensed under the MIT license. import { AbortSignalLike } from "@azure/abort-controller"; import { LongRunningOperation, LroResponse } from "@azure/core-lro"; @@ -28,15 +28,15 @@ export function createLroSpec(inputs: { sendInitialRequest: () => sendOperationFn(args, spec), sendPollRequest: ( path: string, - options?: { abortSignal?: AbortSignalLike } + options?: { abortSignal?: AbortSignalLike }, ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, httpMethod: "GET", path, - abortSignal: options?.abortSignal + abortSignal: options?.abortSignal, }); - } + }, }; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/models/index.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/models/index.ts index 6d578daa7def..f1ebc58f74a3 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/models/index.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/models/index.ts @@ -129,7 +129,7 @@ export interface AccountListResult { nextLink?: string; } -/** Account properties */ +/** Account resource properties. */ export interface AccountProperties { /** * The Playwright testing dashboard URI for the account resource. @@ -142,6 +142,8 @@ export interface AccountProperties { scalableExecution?: EnablementStatus; /** 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; + /** When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. */ + localAuth?: EnablementStatus; /** * The status of the last operation. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -152,7 +154,7 @@ export interface AccountProperties { /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + * Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly id?: string; @@ -189,6 +191,24 @@ export interface SystemData { lastModifiedAt?: Date; } +/** The check availability request body. */ +export interface CheckNameAvailabilityRequest { + /** The name of the resource for which availability needs to be checked. */ + name?: string; + /** The resource type. */ + type?: string; +} + +/** The check availability result. */ +export interface CheckNameAvailabilityResponse { + /** Indicates if the resource name is available. */ + nameAvailable?: boolean; + /** The reason why the given name is not available. */ + reason?: CheckNameAvailabilityReason; + /** Detailed reason why the given name is available. */ + message?: string; +} + /** The response of a Quota list operation. */ export interface QuotaListResult { /** The Quota items on this page */ @@ -197,10 +217,15 @@ export interface QuotaListResult { nextLink?: string; } -/** Quota properties */ +/** The subscription quota resource properties. */ export interface QuotaProperties { - /** The free-trial quota. */ + /** The subscription quota resource free-trial properties. */ freeTrial?: FreeTrialProperties; + /** + * Indicates the offering type for the subscription. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly offeringType?: OfferingType; /** * The status of the last operation. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -208,13 +233,61 @@ export interface QuotaProperties { readonly provisioningState?: ProvisioningState; } -/** The free-trial properties */ +/** The subscription quota resource free-trial properties. */ export interface FreeTrialProperties { /** - * The playwright account id. + * The Playwright service account id. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly accountId: string; + /** + * The free-trial state. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly state: FreeTrialState; +} + +/** The type used for update operations of the Account. */ +export interface AccountUpdate { + /** Resource tags. */ + tags?: { [propertyName: string]: string }; + /** The resource-specific properties for this resource. */ + properties?: AccountUpdateProperties; +} + +/** The updatable properties of the Account. */ +export interface AccountUpdateProperties { + /** 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. */ + regionalAffinity?: EnablementStatus; + /** 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. */ + scalableExecution?: EnablementStatus; + /** 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; + /** When enabled, this feature allows the workspace to use local auth(through access key) for authentication of test runs. */ + localAuth?: EnablementStatus; +} + +/** The response of a AccountQuota list operation. */ +export interface AccountQuotaListResult { + /** The AccountQuota items on this page */ + value: AccountQuota[]; + /** The link to the next page of items */ + nextLink?: string; +} + +/** The Playwright service account quota resource properties. */ +export interface AccountQuotaProperties { + /** The Playwright service account quota resource free-trial properties. */ + freeTrial?: AccountFreeTrialProperties; + /** + * The status of the last operation. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; +} + +/** The Playwright service account quota resource free-trial properties. */ +export interface AccountFreeTrialProperties { /** * The free-trial createdAt utcDateTime. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -240,29 +313,6 @@ export interface FreeTrialProperties { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly percentageUsed: number; - /** - * The free-trial state. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly state: FreeTrialState; -} - -/** The type used for update operations of the Account. */ -export interface AccountUpdate { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The updatable properties of the Account. */ - properties?: AccountUpdateProperties; -} - -/** The updatable properties of the Account. */ -export interface AccountUpdateProperties { - /** 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. */ - regionalAffinity?: EnablementStatus; - /** 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. */ - scalableExecution?: EnablementStatus; - /** 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; } /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ @@ -276,18 +326,24 @@ export interface TrackedResource extends Resource { /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} -/** An account resource */ +/** A Playwright service account resource. */ export interface Account extends TrackedResource { /** The resource-specific properties for this resource. */ properties?: AccountProperties; } -/** A quota resource */ +/** A subscription quota resource. */ export interface Quota extends ProxyResource { /** The resource-specific properties for this resource. */ properties?: QuotaProperties; } +/** A quota resource for a Playwright service account. */ +export interface AccountQuota extends ProxyResource { + /** The resource-specific properties for this resource. */ + properties?: AccountQuotaProperties; +} + /** Defines headers for Accounts_createOrUpdate operation. */ export interface AccountsCreateOrUpdateHeaders { /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ @@ -296,10 +352,10 @@ export interface AccountsCreateOrUpdateHeaders { /** Defines headers for Accounts_delete operation. */ export interface AccountsDeleteHeaders { - /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ - retryAfter?: number; /** The Location header contains the URL where the status of the long running operation can be checked. */ location?: string; + /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ + retryAfter?: number; } /** Known values of {@link Origin} that the service accepts. */ @@ -309,7 +365,7 @@ export enum KnownOrigin { /** System */ System = "system", /** UserSystem */ - UserSystem = "user,system" + UserSystem = "user,system", } /** @@ -326,7 +382,7 @@ export type Origin = string; /** Known values of {@link ActionType} that the service accepts. */ export enum KnownActionType { /** Internal */ - Internal = "Internal" + Internal = "Internal", } /** @@ -343,7 +399,7 @@ export enum KnownEnablementStatus { /** The feature is Enabled. */ Enabled = "Enabled", /** The feature is Disabled. */ - Disabled = "Disabled" + Disabled = "Disabled", } /** @@ -364,10 +420,12 @@ export enum KnownProvisioningState { Failed = "Failed", /** Resource creation was canceled. */ Canceled = "Canceled", - /** Deletion in progress */ + /** Creation in progress.. */ + Creating = "Creating", + /** Deletion in progress.. */ Deleting = "Deleting", - /** Change accepted for processing */ - Accepted = "Accepted" + /** Change accepted for processing.. */ + Accepted = "Accepted", } /** @@ -378,8 +436,9 @@ export enum KnownProvisioningState { * **Succeeded**: Resource has been created. \ * **Failed**: Resource creation failed. \ * **Canceled**: Resource creation was canceled. \ - * **Deleting**: Deletion in progress \ - * **Accepted**: Change accepted for processing + * **Creating**: Creation in progress.. \ + * **Deleting**: Deletion in progress.. \ + * **Accepted**: Change accepted for processing.. */ export type ProvisioningState = string; @@ -392,7 +451,7 @@ export enum KnownCreatedByType { /** ManagedIdentity */ ManagedIdentity = "ManagedIdentity", /** Key */ - Key = "Key" + Key = "Key", } /** @@ -407,12 +466,34 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; +/** Known values of {@link CheckNameAvailabilityReason} that the service accepts. */ +export enum KnownCheckNameAvailabilityReason { + /** Invalid */ + Invalid = "Invalid", + /** AlreadyExists */ + AlreadyExists = "AlreadyExists", +} + +/** + * Defines values for CheckNameAvailabilityReason. \ + * {@link KnownCheckNameAvailabilityReason} can be used interchangeably with CheckNameAvailabilityReason, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Invalid** \ + * **AlreadyExists** + */ +export type CheckNameAvailabilityReason = string; + /** Known values of {@link FreeTrialState} that the service accepts. */ export enum KnownFreeTrialState { /** The free-trial is Active. */ Active = "Active", /** The free-trial is Expired. */ - Expired = "Expired" + Expired = "Expired", + /** The free-trial is Not Eligible. */ + NotEligible = "NotEligible", + /** The free-trial is Not Registered. */ + NotRegistered = "NotRegistered", } /** @@ -421,14 +502,42 @@ export enum KnownFreeTrialState { * this enum contains the known values that the service supports. * ### Known values supported by the service * **Active**: The free-trial is Active. \ - * **Expired**: The free-trial is Expired. + * **Expired**: The free-trial is Expired. \ + * **NotEligible**: The free-trial is Not Eligible. \ + * **NotRegistered**: The free-trial is Not Registered. */ export type FreeTrialState = string; +/** Known values of {@link OfferingType} that the service accepts. */ +export enum KnownOfferingType { + /** The offeringType is NotApplicable. */ + NotApplicable = "NotApplicable", + /** The offeringType is PrivatePreview. */ + PrivatePreview = "PrivatePreview", + /** The offeringType is PublicPreview. */ + PublicPreview = "PublicPreview", + /** The offeringType is GeneralAvailability. */ + GeneralAvailability = "GeneralAvailability", +} + +/** + * Defines values for OfferingType. \ + * {@link KnownOfferingType} can be used interchangeably with OfferingType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **NotApplicable**: The offeringType is NotApplicable. \ + * **PrivatePreview**: The offeringType is PrivatePreview. \ + * **PublicPreview**: The offeringType is PublicPreview. \ + * **GeneralAvailability**: The offeringType is GeneralAvailability. + */ +export type OfferingType = string; + /** Known values of {@link QuotaNames} that the service accepts. */ export enum KnownQuotaNames { /** The quota details for scalable execution feature. 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. */ - ScalableExecution = "ScalableExecution" + ScalableExecution = "ScalableExecution", + /** The quota details for reporting feature. When enabled, Playwright client will be able to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. */ + Reporting = "Reporting", } /** @@ -436,7 +545,8 @@ export enum KnownQuotaNames { * {@link KnownQuotaNames} can be used interchangeably with QuotaNames, * this enum contains the known values that the service supports. * ### Known values supported by the service - * **ScalableExecution**: The quota details for scalable execution feature. 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. + * **ScalableExecution**: The quota details for scalable execution feature. 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. \ + * **Reporting**: The quota details for reporting feature. When enabled, Playwright client will be able to upload and display test results, including artifacts like traces and screenshots, in the Playwright portal. This enables faster and more efficient troubleshooting. */ export type QuotaNames = string; @@ -461,6 +571,14 @@ export interface AccountsListBySubscriptionOptionalParams /** Contains response data for the listBySubscription operation. */ export type AccountsListBySubscriptionResponse = AccountListResult; +/** Optional parameters. */ +export interface AccountsCheckNameAvailabilityOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the checkNameAvailability operation. */ +export type AccountsCheckNameAvailabilityResponse = + CheckNameAvailabilityResponse; + /** Optional parameters. */ export interface AccountsListByResourceGroupOptionalParams extends coreClient.OperationOptions {} @@ -503,6 +621,9 @@ export interface AccountsDeleteOptionalParams resumeFrom?: string; } +/** Contains response data for the delete operation. */ +export type AccountsDeleteResponse = AccountsDeleteHeaders; + /** Optional parameters. */ export interface AccountsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions {} @@ -537,6 +658,27 @@ export interface QuotasListBySubscriptionNextOptionalParams /** Contains response data for the listBySubscriptionNext operation. */ export type QuotasListBySubscriptionNextResponse = QuotaListResult; +/** Optional parameters. */ +export interface AccountQuotasListByAccountOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccount operation. */ +export type AccountQuotasListByAccountResponse = AccountQuotaListResult; + +/** Optional parameters. */ +export interface AccountQuotasGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type AccountQuotasGetResponse = AccountQuota; + +/** Optional parameters. */ +export interface AccountQuotasListByAccountNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByAccountNext operation. */ +export type AccountQuotasListByAccountNextResponse = AccountQuotaListResult; + /** Optional parameters. */ export interface PlaywrightTestingClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/models/mappers.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/models/mappers.ts index 3aef08e4bc08..9f79795b8a0b 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/models/mappers.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/models/mappers.ts @@ -21,20 +21,20 @@ export const OperationListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Operation" - } - } - } + className: "Operation", + }, + }, + }, }, nextLink: { serializedName: "nextLink", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Operation: coreClient.CompositeMapper = { @@ -46,39 +46,39 @@ export const Operation: coreClient.CompositeMapper = { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, isDataAction: { serializedName: "isDataAction", readOnly: true, type: { - name: "Boolean" - } + name: "Boolean", + }, }, display: { serializedName: "display", type: { name: "Composite", - className: "OperationDisplay" - } + className: "OperationDisplay", + }, }, origin: { serializedName: "origin", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, actionType: { serializedName: "actionType", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const OperationDisplay: coreClient.CompositeMapper = { @@ -90,32 +90,32 @@ export const OperationDisplay: coreClient.CompositeMapper = { serializedName: "provider", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, resource: { serializedName: "resource", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, operation: { serializedName: "operation", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, description: { serializedName: "description", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ErrorResponse: coreClient.CompositeMapper = { @@ -127,11 +127,11 @@ export const ErrorResponse: coreClient.CompositeMapper = { serializedName: "error", type: { name: "Composite", - className: "ErrorDetail" - } - } - } - } + className: "ErrorDetail", + }, + }, + }, + }, }; export const ErrorDetail: coreClient.CompositeMapper = { @@ -143,22 +143,22 @@ export const ErrorDetail: coreClient.CompositeMapper = { serializedName: "code", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, message: { serializedName: "message", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, target: { serializedName: "target", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, details: { serializedName: "details", @@ -168,10 +168,10 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorDetail" - } - } - } + className: "ErrorDetail", + }, + }, + }, }, additionalInfo: { serializedName: "additionalInfo", @@ -181,13 +181,13 @@ export const ErrorDetail: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "ErrorAdditionalInfo" - } - } - } - } - } - } + className: "ErrorAdditionalInfo", + }, + }, + }, + }, + }, + }, }; export const ErrorAdditionalInfo: coreClient.CompositeMapper = { @@ -199,19 +199,19 @@ export const ErrorAdditionalInfo: coreClient.CompositeMapper = { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, info: { serializedName: "info", readOnly: true, type: { name: "Dictionary", - value: { type: { name: "any" } } - } - } - } - } + value: { type: { name: "any" } }, + }, + }, + }, + }, }; export const AccountListResult: coreClient.CompositeMapper = { @@ -227,19 +227,19 @@ export const AccountListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Account" - } - } - } + className: "Account", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AccountProperties: coreClient.CompositeMapper = { @@ -251,36 +251,42 @@ export const AccountProperties: coreClient.CompositeMapper = { serializedName: "dashboardUri", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, regionalAffinity: { serializedName: "regionalAffinity", type: { - name: "String" - } + name: "String", + }, }, scalableExecution: { serializedName: "scalableExecution", type: { - name: "String" - } + name: "String", + }, }, reporting: { serializedName: "reporting", type: { - name: "String" - } + name: "String", + }, + }, + localAuth: { + serializedName: "localAuth", + type: { + name: "String", + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const Resource: coreClient.CompositeMapper = { @@ -292,32 +298,32 @@ export const Resource: coreClient.CompositeMapper = { serializedName: "id", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, name: { serializedName: "name", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, type: { serializedName: "type", readOnly: true, type: { - name: "String" - } + name: "String", + }, }, systemData: { serializedName: "systemData", type: { name: "Composite", - className: "SystemData" - } - } - } - } + className: "SystemData", + }, + }, + }, + }, }; export const SystemData: coreClient.CompositeMapper = { @@ -328,41 +334,89 @@ export const SystemData: coreClient.CompositeMapper = { createdBy: { serializedName: "createdBy", type: { - name: "String" - } + name: "String", + }, }, createdByType: { serializedName: "createdByType", type: { - name: "String" - } + name: "String", + }, }, createdAt: { serializedName: "createdAt", type: { - name: "DateTime" - } + name: "DateTime", + }, }, lastModifiedBy: { serializedName: "lastModifiedBy", type: { - name: "String" - } + name: "String", + }, }, lastModifiedByType: { serializedName: "lastModifiedByType", type: { - name: "String" - } + name: "String", + }, }, lastModifiedAt: { serializedName: "lastModifiedAt", type: { - name: "DateTime" - } - } - } - } + name: "DateTime", + }, + }, + }, + }, +}; + +export const CheckNameAvailabilityRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityRequest", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String", + }, + }, + type: { + serializedName: "type", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const CheckNameAvailabilityResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "CheckNameAvailabilityResponse", + modelProperties: { + nameAvailable: { + serializedName: "nameAvailable", + type: { + name: "Boolean", + }, + }, + reason: { + serializedName: "reason", + type: { + name: "String", + }, + }, + message: { + serializedName: "message", + type: { + name: "String", + }, + }, + }, + }, }; export const QuotaListResult: coreClient.CompositeMapper = { @@ -378,19 +432,19 @@ export const QuotaListResult: coreClient.CompositeMapper = { element: { type: { name: "Composite", - className: "Quota" - } - } - } + className: "Quota", + }, + }, + }, }, nextLink: { serializedName: "nextLink", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const QuotaProperties: coreClient.CompositeMapper = { @@ -402,18 +456,25 @@ export const QuotaProperties: coreClient.CompositeMapper = { serializedName: "freeTrial", type: { name: "Composite", - className: "FreeTrialProperties" - } + className: "FreeTrialProperties", + }, + }, + offeringType: { + serializedName: "offeringType", + readOnly: true, + type: { + name: "String", + }, }, provisioningState: { serializedName: "provisioningState", readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const FreeTrialProperties: coreClient.CompositeMapper = { @@ -426,63 +487,19 @@ export const FreeTrialProperties: coreClient.CompositeMapper = { required: true, readOnly: true, type: { - name: "String" - } - }, - createdAt: { - serializedName: "createdAt", - required: true, - readOnly: true, - type: { - name: "DateTime" - } - }, - expiryAt: { - serializedName: "expiryAt", - required: true, - readOnly: true, - type: { - name: "DateTime" - } - }, - allocatedValue: { - serializedName: "allocatedValue", - required: true, - readOnly: true, - type: { - name: "Number" - } - }, - usedValue: { - serializedName: "usedValue", - required: true, - readOnly: true, - type: { - name: "Number" - } - }, - percentageUsed: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0 + name: "String", }, - serializedName: "percentageUsed", - required: true, - readOnly: true, - type: { - name: "Number" - } }, state: { serializedName: "state", required: true, readOnly: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const AccountUpdate: coreClient.CompositeMapper = { @@ -494,18 +511,18 @@ export const AccountUpdate: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, properties: { serializedName: "properties", type: { name: "Composite", - className: "AccountUpdateProperties" - } - } - } - } + className: "AccountUpdateProperties", + }, + }, + }, + }, }; export const AccountUpdateProperties: coreClient.CompositeMapper = { @@ -516,23 +533,133 @@ export const AccountUpdateProperties: coreClient.CompositeMapper = { regionalAffinity: { serializedName: "regionalAffinity", type: { - name: "String" - } + name: "String", + }, }, scalableExecution: { serializedName: "scalableExecution", type: { - name: "String" - } + name: "String", + }, }, reporting: { serializedName: "reporting", type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + localAuth: { + serializedName: "localAuth", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccountQuotaListResult: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountQuotaListResult", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "AccountQuota", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccountQuotaProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountQuotaProperties", + modelProperties: { + freeTrial: { + serializedName: "freeTrial", + type: { + name: "Composite", + className: "AccountFreeTrialProperties", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const AccountFreeTrialProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountFreeTrialProperties", + modelProperties: { + createdAt: { + serializedName: "createdAt", + required: true, + readOnly: true, + type: { + name: "DateTime", + }, + }, + expiryAt: { + serializedName: "expiryAt", + required: true, + readOnly: true, + type: { + name: "DateTime", + }, + }, + allocatedValue: { + serializedName: "allocatedValue", + required: true, + readOnly: true, + type: { + name: "Number", + }, + }, + usedValue: { + serializedName: "usedValue", + required: true, + readOnly: true, + type: { + name: "Number", + }, + }, + percentageUsed: { + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0, + }, + serializedName: "percentageUsed", + required: true, + readOnly: true, + type: { + name: "Number", + }, + }, + }, + }, }; export const TrackedResource: coreClient.CompositeMapper = { @@ -545,18 +672,18 @@ export const TrackedResource: coreClient.CompositeMapper = { serializedName: "tags", type: { name: "Dictionary", - value: { type: { name: "String" } } - } + value: { type: { name: "String" } }, + }, }, location: { serializedName: "location", required: true, type: { - name: "String" - } - } - } - } + name: "String", + }, + }, + }, + }, }; export const ProxyResource: coreClient.CompositeMapper = { @@ -564,9 +691,9 @@ export const ProxyResource: coreClient.CompositeMapper = { name: "Composite", className: "ProxyResource", modelProperties: { - ...Resource.type.modelProperties - } - } + ...Resource.type.modelProperties, + }, + }, }; export const Account: coreClient.CompositeMapper = { @@ -579,11 +706,11 @@ export const Account: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "AccountProperties" - } - } - } - } + className: "AccountProperties", + }, + }, + }, + }, }; export const Quota: coreClient.CompositeMapper = { @@ -596,11 +723,28 @@ export const Quota: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "QuotaProperties" - } - } - } - } + className: "QuotaProperties", + }, + }, + }, + }, +}; + +export const AccountQuota: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "AccountQuota", + modelProperties: { + ...ProxyResource.type.modelProperties, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "AccountQuotaProperties", + }, + }, + }, + }, }; export const AccountsCreateOrUpdateHeaders: coreClient.CompositeMapper = { @@ -611,11 +755,11 @@ export const AccountsCreateOrUpdateHeaders: coreClient.CompositeMapper = { retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } - } - } - } + name: "Number", + }, + }, + }, + }, }; export const AccountsDeleteHeaders: coreClient.CompositeMapper = { @@ -623,18 +767,18 @@ export const AccountsDeleteHeaders: coreClient.CompositeMapper = { name: "Composite", className: "AccountsDeleteHeaders", modelProperties: { + location: { + serializedName: "location", + type: { + name: "String", + }, + }, retryAfter: { serializedName: "retry-after", type: { - name: "Number" - } + name: "Number", + }, }, - location: { - serializedName: "location", - type: { - name: "String" - } - } - } - } + }, + }, }; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/models/parameters.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/models/parameters.ts index 7ad813f01c90..be272dc83b9e 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/models/parameters.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/models/parameters.ts @@ -9,11 +9,12 @@ import { OperationParameter, OperationURLParameter, - OperationQueryParameter + OperationQueryParameter, } from "@azure/core-client"; import { + CheckNameAvailabilityRequest as CheckNameAvailabilityRequestMapper, Account as AccountMapper, - AccountUpdate as AccountUpdateMapper + AccountUpdate as AccountUpdateMapper, } from "../models/mappers"; export const accept: OperationParameter = { @@ -23,9 +24,9 @@ export const accept: OperationParameter = { isConstant: true, serializedName: "Accept", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const $host: OperationURLParameter = { @@ -34,22 +35,22 @@ export const $host: OperationURLParameter = { serializedName: "$host", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-10-01-preview", + defaultValue: "2024-08-01-preview", isConstant: true, serializedName: "api-version", type: { - name: "String" - } - } + name: "String", + }, + }, }; export const nextLink: OperationURLParameter = { @@ -58,24 +59,38 @@ export const nextLink: OperationURLParameter = { serializedName: "nextLink", required: true, type: { - name: "String" - } + name: "String", + }, }, - skipEncoding: true + skipEncoding: true, }; export const subscriptionId: OperationURLParameter = { parameterPath: "subscriptionId", mapper: { - constraints: { - MinLength: 1 - }, serializedName: "subscriptionId", required: true, type: { - name: "String" - } - } + name: "Uuid", + }, + }, +}; + +export const contentType: OperationParameter = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/json", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String", + }, + }, +}; + +export const body: OperationParameter = { + parameterPath: "body", + mapper: CheckNameAvailabilityRequestMapper, }; export const resourceGroupName: OperationURLParameter = { @@ -83,52 +98,40 @@ export const resourceGroupName: OperationURLParameter = { mapper: { constraints: { MaxLength: 90, - MinLength: 1 + MinLength: 1, }, serializedName: "resourceGroupName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const name: OperationURLParameter = { - parameterPath: "name", +export const accountName: OperationURLParameter = { + parameterPath: "accountName", mapper: { constraints: { Pattern: new RegExp("^[a-zA-Z]{1}[a-zA-Z0-9]{2,63}$"), MaxLength: 64, - MinLength: 3 + MinLength: 3, }, - serializedName: "name", + serializedName: "accountName", required: true, type: { - name: "String" - } - } -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } - } + name: "String", + }, + }, }; export const resource: OperationParameter = { parameterPath: "resource", - mapper: AccountMapper + mapper: AccountMapper, }; export const properties: OperationParameter = { parameterPath: "properties", - mapper: AccountUpdateMapper + mapper: AccountUpdateMapper, }; export const location: OperationURLParameter = { @@ -137,18 +140,18 @@ export const location: OperationURLParameter = { serializedName: "location", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; -export const name1: OperationURLParameter = { - parameterPath: "name", +export const quotaName: OperationURLParameter = { + parameterPath: "quotaName", mapper: { - serializedName: "name", + serializedName: "quotaName", required: true, type: { - name: "String" - } - } + name: "String", + }, + }, }; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accountQuotas.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accountQuotas.ts new file mode 100644 index 000000000000..454707fb9b11 --- /dev/null +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accountQuotas.ts @@ -0,0 +1,245 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; +import { AccountQuotas } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { PlaywrightTestingClient } from "../playwrightTestingClient"; +import { + AccountQuota, + AccountQuotasListByAccountNextOptionalParams, + AccountQuotasListByAccountOptionalParams, + AccountQuotasListByAccountResponse, + QuotaNames, + AccountQuotasGetOptionalParams, + AccountQuotasGetResponse, + AccountQuotasListByAccountNextResponse, +} from "../models"; + +/// +/** Class containing AccountQuotas operations. */ +export class AccountQuotasImpl implements AccountQuotas { + private readonly client: PlaywrightTestingClient; + + /** + * Initialize a new instance of the class AccountQuotas class. + * @param client Reference to the service client + */ + constructor(client: PlaywrightTestingClient) { + this.client = client; + } + + /** + * List quotas for a given account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param options The options parameters. + */ + public listByAccount( + resourceGroupName: string, + accountName: string, + options?: AccountQuotasListByAccountOptionalParams, + ): PagedAsyncIterableIterator { + const iter = this.listByAccountPagingAll( + resourceGroupName, + accountName, + options, + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByAccountPagingPage( + resourceGroupName, + accountName, + options, + settings, + ); + }, + }; + } + + private async *listByAccountPagingPage( + resourceGroupName: string, + accountName: string, + options?: AccountQuotasListByAccountOptionalParams, + settings?: PageSettings, + ): AsyncIterableIterator { + let result: AccountQuotasListByAccountResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByAccount( + resourceGroupName, + accountName, + options, + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } + while (continuationToken) { + result = await this._listByAccountNext( + resourceGroupName, + accountName, + continuationToken, + options, + ); + continuationToken = result.nextLink; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; + } + } + + private async *listByAccountPagingAll( + resourceGroupName: string, + accountName: string, + options?: AccountQuotasListByAccountOptionalParams, + ): AsyncIterableIterator { + for await (const page of this.listByAccountPagingPage( + resourceGroupName, + accountName, + options, + )) { + yield* page; + } + } + + /** + * List quotas for a given account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param options The options parameters. + */ + private _listByAccount( + resourceGroupName: string, + accountName: string, + options?: AccountQuotasListByAccountOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, options }, + listByAccountOperationSpec, + ); + } + + /** + * Get quota by name for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + quotaName: QuotaNames, + options?: AccountQuotasGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, quotaName, options }, + getOperationSpec, + ); + } + + /** + * ListByAccountNext + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param nextLink The nextLink from the previous successful call to the ListByAccount method. + * @param options The options parameters. + */ + private _listByAccountNext( + resourceGroupName: string, + accountName: string, + nextLink: string, + options?: AccountQuotasListByAccountNextOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, accountName, nextLink, options }, + listByAccountNextOperationSpec, + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByAccountOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountQuotaListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const getOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}/quotas/{quotaName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountQuota, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + Parameters.quotaName, + ], + headerParameters: [Parameters.accept], + serializer, +}; +const listByAccountNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.AccountQuotaListResult, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.accountName, + ], + headerParameters: [Parameters.accept], + serializer, +}; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accounts.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accounts.ts index 75ff86897593..a3b017337ffc 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accounts.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/accounts.ts @@ -16,7 +16,7 @@ import { PlaywrightTestingClient } from "../playwrightTestingClient"; import { SimplePollerLike, OperationState, - createHttpPoller + createHttpPoller, } from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { @@ -27,6 +27,9 @@ import { AccountsListByResourceGroupNextOptionalParams, AccountsListByResourceGroupOptionalParams, AccountsListByResourceGroupResponse, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, AccountsGetOptionalParams, AccountsGetResponse, AccountsCreateOrUpdateOptionalParams, @@ -35,8 +38,9 @@ import { AccountsUpdateOptionalParams, AccountsUpdateResponse, AccountsDeleteOptionalParams, + AccountsDeleteResponse, AccountsListBySubscriptionNextResponse, - AccountsListByResourceGroupNextResponse + AccountsListByResourceGroupNextResponse, } from "../models"; /// @@ -57,7 +61,7 @@ export class AccountsImpl implements Accounts { * @param options The options parameters. */ public listBySubscription( - options?: AccountsListBySubscriptionOptionalParams + options?: AccountsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(options); return { @@ -72,13 +76,13 @@ export class AccountsImpl implements Accounts { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( options?: AccountsListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AccountsListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -99,7 +103,7 @@ export class AccountsImpl implements Accounts { } private async *listBySubscriptionPagingAll( - options?: AccountsListBySubscriptionOptionalParams + options?: AccountsListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage(options)) { yield* page; @@ -113,7 +117,7 @@ export class AccountsImpl implements Accounts { */ public listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); return { @@ -130,16 +134,16 @@ export class AccountsImpl implements Accounts { return this.listByResourceGroupPagingPage( resourceGroupName, options, - settings + settings, ); - } + }, }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, options?: AccountsListByResourceGroupOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: AccountsListByResourceGroupResponse; let continuationToken = settings?.continuationToken; @@ -154,7 +158,7 @@ export class AccountsImpl implements Accounts { result = await this._listByResourceGroupNext( resourceGroupName, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -165,11 +169,11 @@ export class AccountsImpl implements Accounts { private async *listByResourceGroupPagingAll( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): AsyncIterableIterator { for await (const page of this.listByResourceGroupPagingPage( resourceGroupName, - options + options, )) { yield* page; } @@ -180,11 +184,27 @@ export class AccountsImpl implements Accounts { * @param options The options parameters. */ private _listBySubscription( - options?: AccountsListBySubscriptionOptionalParams + options?: AccountsListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, + ); + } + + /** + * Adds check global name availability operation, normally used if a resource name must be globally + * unique. + * @param body The CheckAvailability request + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { body, options }, + checkNameAvailabilityOperationSpec, ); } @@ -195,43 +215,43 @@ export class AccountsImpl implements Accounts { */ private _listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, options }, - listByResourceGroupOperationSpec + listByResourceGroupOperationSpec, ); } /** * Get a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ get( resourceGroupName: string, - name: string, - options?: AccountsGetOptionalParams + accountName: string, + options?: AccountsGetOptionalParams, ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, name, options }, - getOperationSpec + { resourceGroupName, accountName, options }, + getOperationSpec, ); } /** * Create a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param resource Resource create parameters. * @param options The options parameters. */ async beginCreateOrUpdate( resourceGroupName: string, - name: string, + accountName: string, resource: Account, - options?: AccountsCreateOrUpdateOptionalParams + options?: AccountsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -240,21 +260,20 @@ export class AccountsImpl implements Accounts { > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -263,8 +282,8 @@ export class AccountsImpl implements Accounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -272,15 +291,15 @@ export class AccountsImpl implements Accounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, name, resource, options }, - spec: createOrUpdateOperationSpec + args: { resourceGroupName, accountName, resource, options }, + spec: createOrUpdateOperationSpec, }); const poller = await createHttpPoller< AccountsCreateOrUpdateResponse, @@ -288,7 +307,7 @@ export class AccountsImpl implements Accounts { >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "azure-async-operation" + resourceLocationConfig: "azure-async-operation", }); await poller.poll(); return poller; @@ -297,21 +316,21 @@ export class AccountsImpl implements Accounts { /** * Create a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param resource Resource create parameters. * @param options The options parameters. */ async beginCreateOrUpdateAndWait( resourceGroupName: string, - name: string, + accountName: string, resource: Account, - options?: AccountsCreateOrUpdateOptionalParams + options?: AccountsCreateOrUpdateOptionalParams, ): Promise { const poller = await this.beginCreateOrUpdate( resourceGroupName, - name, + accountName, resource, - options + options, ); return poller.pollUntilDone(); } @@ -319,50 +338,54 @@ export class AccountsImpl implements Accounts { /** * Update a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param properties The resource properties to be updated. * @param options The options parameters. */ update( resourceGroupName: string, - name: string, + accountName: string, properties: AccountUpdate, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise { return this.client.sendOperationRequest( - { resourceGroupName, name, properties, options }, - updateOperationSpec + { resourceGroupName, accountName, properties, options }, + updateOperationSpec, ); } /** * Delete a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ async beginDelete( resourceGroupName: string, - name: string, - options?: AccountsDeleteOptionalParams - ): Promise, void>> { + accountName: string, + options?: AccountsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AccountsDeleteResponse + > + > { const directSendOperation = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec - ): Promise => { + spec: coreClient.OperationSpec, + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, - spec: coreClient.OperationSpec + spec: coreClient.OperationSpec, ) => { - let currentRawResponse: - | coreClient.FullOperationResponse - | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown + flatResponse: unknown, ) => { currentRawResponse = rawResponse; providedCallback?.(rawResponse, flatResponse); @@ -371,8 +394,8 @@ export class AccountsImpl implements Accounts { ...args, options: { ...args.options, - onResponse: callback - } + onResponse: callback, + }, }; const flatResponse = await directSendOperation(updatedArgs, spec); return { @@ -380,20 +403,23 @@ export class AccountsImpl implements Accounts { rawResponse: { statusCode: currentRawResponse!.status, body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON() - } + headers: currentRawResponse!.headers.toJSON(), + }, }; }; const lro = createLroSpec({ sendOperationFn, - args: { resourceGroupName, name, options }, - spec: deleteOperationSpec + args: { resourceGroupName, accountName, options }, + spec: deleteOperationSpec, }); - const poller = await createHttpPoller>(lro, { + const poller = await createHttpPoller< + AccountsDeleteResponse, + OperationState + >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location" + resourceLocationConfig: "location", }); await poller.poll(); return poller; @@ -402,15 +428,19 @@ export class AccountsImpl implements Accounts { /** * Delete a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ async beginDeleteAndWait( resourceGroupName: string, - name: string, - options?: AccountsDeleteOptionalParams - ): Promise { - const poller = await this.beginDelete(resourceGroupName, name, options); + accountName: string, + options?: AccountsDeleteOptionalParams, + ): Promise { + const poller = await this.beginDelete( + resourceGroupName, + accountName, + options, + ); return poller.pollUntilDone(); } @@ -421,11 +451,11 @@ export class AccountsImpl implements Accounts { */ private _listBySubscriptionNext( nextLink: string, - options?: AccountsListBySubscriptionNextOptionalParams + options?: AccountsListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } @@ -438,11 +468,11 @@ export class AccountsImpl implements Accounts { private _listByResourceGroupNext( resourceGroupName: string, nextLink: string, - options?: AccountsListByResourceGroupNextOptionalParams + options?: AccountsListByResourceGroupNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec + listByResourceGroupNextOperationSpec, ); } } @@ -450,85 +480,99 @@ export class AccountsImpl implements Accounts { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/accounts", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/accounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], - serializer + serializer, +}; +const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { + path: "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/checkNameAvailability", + httpMethod: "POST", + responses: { + 200: { + bodyMapper: Mappers.CheckNameAvailabilityResponse, + }, + default: { + bodyMapper: Mappers.ErrorResponse, + }, + }, + requestBody: Parameters.body, + queryParameters: [Parameters.apiVersion], + urlParameters: [Parameters.$host, Parameters.subscriptionId], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer, }; const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.name + Parameters.accountName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 201: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 202: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, 204: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.resource, queryParameters: [Parameters.apiVersion], @@ -536,23 +580,22 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.name + Parameters.accountName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const updateOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.Account + bodyMapper: Mappers.Account, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, requestBody: Parameters.properties, queryParameters: [Parameters.apiVersion], @@ -560,71 +603,78 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.name + Parameters.accountName, ], headerParameters: [Parameters.accept, Parameters.contentType], mediaType: "json", - serializer + serializer, }; const deleteOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{name}", + path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzurePlaywrightService/accounts/{accountName}", httpMethod: "DELETE", responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, + 200: { + headersMapper: Mappers.AccountsDeleteHeaders, + }, + 201: { + headersMapper: Mappers.AccountsDeleteHeaders, + }, + 202: { + headersMapper: Mappers.AccountsDeleteHeaders, + }, + 204: { + headersMapper: Mappers.AccountsDeleteHeaders, + }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.resourceGroupName, - Parameters.name + Parameters.accountName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, - Parameters.subscriptionId + Parameters.subscriptionId, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.AccountListResult + bodyMapper: Mappers.AccountListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.resourceGroupName + Parameters.resourceGroupName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/index.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/index.ts index e8eae0a6b68b..289b6728c123 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/index.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/index.ts @@ -9,3 +9,4 @@ export * from "./operations"; export * from "./accounts"; export * from "./quotas"; +export * from "./accountQuotas"; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/operations.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/operations.ts index d22feda4a79d..27c7c8b1a7cd 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/operations.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/operations.ts @@ -18,7 +18,7 @@ import { OperationsListNextOptionalParams, OperationsListOptionalParams, OperationsListResponse, - OperationsListNextResponse + OperationsListNextResponse, } from "../models"; /// @@ -39,7 +39,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ public list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listPagingAll(options); return { @@ -54,13 +54,13 @@ export class OperationsImpl implements Operations { throw new Error("maxPageSize is not supported by this operation."); } return this.listPagingPage(options, settings); - } + }, }; } private async *listPagingPage( options?: OperationsListOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: OperationsListResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class OperationsImpl implements Operations { } private async *listPagingAll( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): AsyncIterableIterator { for await (const page of this.listPagingPage(options)) { yield* page; @@ -93,7 +93,7 @@ export class OperationsImpl implements Operations { * @param options The options parameters. */ private _list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,11 +105,11 @@ export class OperationsImpl implements Operations { */ private _listNext( nextLink: string, - options?: OperationsListNextOptionalParams + options?: OperationsListNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { nextLink, options }, - listNextOperationSpec + listNextOperationSpec, ); } } @@ -121,29 +121,29 @@ const listOperationSpec: coreClient.OperationSpec = { httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], - serializer + serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.OperationListResult + bodyMapper: Mappers.OperationListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [Parameters.$host, Parameters.nextLink], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/quotas.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/quotas.ts index 5cd4ff68a161..f5e77e01f36a 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operations/quotas.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operations/quotas.ts @@ -21,7 +21,7 @@ import { QuotaNames, QuotasGetOptionalParams, QuotasGetResponse, - QuotasListBySubscriptionNextResponse + QuotasListBySubscriptionNextResponse, } from "../models"; /// @@ -44,7 +44,7 @@ export class QuotasImpl implements Quotas { */ public listBySubscription( location: string, - options?: QuotasListBySubscriptionOptionalParams + options?: QuotasListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator { const iter = this.listBySubscriptionPagingAll(location, options); return { @@ -59,14 +59,14 @@ export class QuotasImpl implements Quotas { throw new Error("maxPageSize is not supported by this operation."); } return this.listBySubscriptionPagingPage(location, options, settings); - } + }, }; } private async *listBySubscriptionPagingPage( location: string, options?: QuotasListBySubscriptionOptionalParams, - settings?: PageSettings + settings?: PageSettings, ): AsyncIterableIterator { let result: QuotasListBySubscriptionResponse; let continuationToken = settings?.continuationToken; @@ -81,7 +81,7 @@ export class QuotasImpl implements Quotas { result = await this._listBySubscriptionNext( location, continuationToken, - options + options, ); continuationToken = result.nextLink; let page = result.value || []; @@ -92,11 +92,11 @@ export class QuotasImpl implements Quotas { private async *listBySubscriptionPagingAll( location: string, - options?: QuotasListBySubscriptionOptionalParams + options?: QuotasListBySubscriptionOptionalParams, ): AsyncIterableIterator { for await (const page of this.listBySubscriptionPagingPage( location, - options + options, )) { yield* page; } @@ -109,28 +109,28 @@ export class QuotasImpl implements Quotas { */ private _listBySubscription( location: string, - options?: QuotasListBySubscriptionOptionalParams + options?: QuotasListBySubscriptionOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, options }, - listBySubscriptionOperationSpec + listBySubscriptionOperationSpec, ); } /** - * Get quota by name. + * Get subscription quota by name. * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param options The options parameters. */ get( location: string, - name: QuotaNames, - options?: QuotasGetOptionalParams + quotaName: QuotaNames, + options?: QuotasGetOptionalParams, ): Promise { return this.client.sendOperationRequest( - { location, name, options }, - getOperationSpec + { location, quotaName, options }, + getOperationSpec, ); } @@ -143,11 +143,11 @@ export class QuotasImpl implements Quotas { private _listBySubscriptionNext( location: string, nextLink: string, - options?: QuotasListBySubscriptionNextOptionalParams + options?: QuotasListBySubscriptionNextOptionalParams, ): Promise { return this.client.sendOperationRequest( { location, nextLink, options }, - listBySubscriptionNextOperationSpec + listBySubscriptionNextOperationSpec, ); } } @@ -155,65 +155,63 @@ export class QuotasImpl implements Quotas { const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaListResult + bodyMapper: Mappers.QuotaListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const getOperationSpec: coreClient.OperationSpec = { - path: - "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{name}", + path: "/subscriptions/{subscriptionId}/providers/Microsoft.AzurePlaywrightService/locations/{location}/quotas/{quotaName}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.Quota + bodyMapper: Mappers.Quota, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, Parameters.location, - Parameters.name1 + Parameters.quotaName, ], headerParameters: [Parameters.accept], - serializer + serializer, }; const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { path: "{nextLink}", httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaListResult + bodyMapper: Mappers.QuotaListResult, }, default: { - bodyMapper: Mappers.ErrorResponse - } + bodyMapper: Mappers.ErrorResponse, + }, }, urlParameters: [ Parameters.$host, Parameters.nextLink, Parameters.subscriptionId, - Parameters.location + Parameters.location, ], headerParameters: [Parameters.accept], - serializer + serializer, }; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accountQuotas.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accountQuotas.ts new file mode 100644 index 000000000000..4a9075774c5b --- /dev/null +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accountQuotas.ts @@ -0,0 +1,45 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + AccountQuota, + AccountQuotasListByAccountOptionalParams, + QuotaNames, + AccountQuotasGetOptionalParams, + AccountQuotasGetResponse, +} from "../models"; + +/// +/** Interface representing a AccountQuotas. */ +export interface AccountQuotas { + /** + * List quotas for a given account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param options The options parameters. + */ + listByAccount( + resourceGroupName: string, + accountName: string, + options?: AccountQuotasListByAccountOptionalParams, + ): PagedAsyncIterableIterator; + /** + * Get quota by name for an account. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Name of account. + * @param quotaName The Playwright service account quota name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + accountName: string, + quotaName: QuotaNames, + options?: AccountQuotasGetOptionalParams, + ): Promise; +} diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accounts.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accounts.ts index 4f2c04a63a1b..eea4572550e0 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accounts.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/accounts.ts @@ -12,6 +12,9 @@ import { Account, AccountsListBySubscriptionOptionalParams, AccountsListByResourceGroupOptionalParams, + CheckNameAvailabilityRequest, + AccountsCheckNameAvailabilityOptionalParams, + AccountsCheckNameAvailabilityResponse, AccountsGetOptionalParams, AccountsGetResponse, AccountsCreateOrUpdateOptionalParams, @@ -19,7 +22,8 @@ import { AccountUpdate, AccountsUpdateOptionalParams, AccountsUpdateResponse, - AccountsDeleteOptionalParams + AccountsDeleteOptionalParams, + AccountsDeleteResponse, } from "../models"; /// @@ -30,7 +34,7 @@ export interface Accounts { * @param options The options parameters. */ listBySubscription( - options?: AccountsListBySubscriptionOptionalParams + options?: AccountsListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** * List Account resources by resource group @@ -39,31 +43,41 @@ export interface Accounts { */ listByResourceGroup( resourceGroupName: string, - options?: AccountsListByResourceGroupOptionalParams + options?: AccountsListByResourceGroupOptionalParams, ): PagedAsyncIterableIterator; + /** + * Adds check global name availability operation, normally used if a resource name must be globally + * unique. + * @param body The CheckAvailability request + * @param options The options parameters. + */ + checkNameAvailability( + body: CheckNameAvailabilityRequest, + options?: AccountsCheckNameAvailabilityOptionalParams, + ): Promise; /** * Get a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ get( resourceGroupName: string, - name: string, - options?: AccountsGetOptionalParams + accountName: string, + options?: AccountsGetOptionalParams, ): Promise; /** * Create a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param resource Resource create parameters. * @param options The options parameters. */ beginCreateOrUpdate( resourceGroupName: string, - name: string, + accountName: string, resource: Account, - options?: AccountsCreateOrUpdateOptionalParams + options?: AccountsCreateOrUpdateOptionalParams, ): Promise< SimplePollerLike< OperationState, @@ -73,49 +87,54 @@ export interface Accounts { /** * Create a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param resource Resource create parameters. * @param options The options parameters. */ beginCreateOrUpdateAndWait( resourceGroupName: string, - name: string, + accountName: string, resource: Account, - options?: AccountsCreateOrUpdateOptionalParams + options?: AccountsCreateOrUpdateOptionalParams, ): Promise; /** * Update a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param properties The resource properties to be updated. * @param options The options parameters. */ update( resourceGroupName: string, - name: string, + accountName: string, properties: AccountUpdate, - options?: AccountsUpdateOptionalParams + options?: AccountsUpdateOptionalParams, ): Promise; /** * Delete a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ beginDelete( resourceGroupName: string, - name: string, - options?: AccountsDeleteOptionalParams - ): Promise, void>>; + accountName: string, + options?: AccountsDeleteOptionalParams, + ): Promise< + SimplePollerLike< + OperationState, + AccountsDeleteResponse + > + >; /** * Delete a Account * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name Name of account + * @param accountName Name of account. * @param options The options parameters. */ beginDeleteAndWait( resourceGroupName: string, - name: string, - options?: AccountsDeleteOptionalParams - ): Promise; + accountName: string, + options?: AccountsDeleteOptionalParams, + ): Promise; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/index.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/index.ts index e8eae0a6b68b..289b6728c123 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/index.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/index.ts @@ -9,3 +9,4 @@ export * from "./operations"; export * from "./accounts"; export * from "./quotas"; +export * from "./accountQuotas"; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/operations.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/operations.ts index 5cf5581845bd..251f5f582e64 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/operations.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/operations.ts @@ -17,6 +17,6 @@ export interface Operations { * @param options The options parameters. */ list( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, ): PagedAsyncIterableIterator; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/quotas.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/quotas.ts index 002703dcda35..069c40448b88 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/quotas.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/operationsInterfaces/quotas.ts @@ -12,7 +12,7 @@ import { QuotasListBySubscriptionOptionalParams, QuotaNames, QuotasGetOptionalParams, - QuotasGetResponse + QuotasGetResponse, } from "../models"; /// @@ -25,17 +25,17 @@ export interface Quotas { */ listBySubscription( location: string, - options?: QuotasListBySubscriptionOptionalParams + options?: QuotasListBySubscriptionOptionalParams, ): PagedAsyncIterableIterator; /** - * Get quota by name. + * Get subscription quota by name. * @param location The location of quota in ARM Normalized format like eastus, southeastasia etc. - * @param name The quota name. + * @param quotaName The quota name. * @param options The options parameters. */ get( location: string, - name: QuotaNames, - options?: QuotasGetOptionalParams + quotaName: QuotaNames, + options?: QuotasGetOptionalParams, ): Promise; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/pagingHelper.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/pagingHelper.ts index 269a2b9814b5..205cccc26592 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/pagingHelper.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/pagingHelper.ts @@ -28,7 +28,7 @@ export function getContinuationToken(page: unknown): string | undefined { export function setContinuationToken( page: unknown, - continuationToken: string | undefined + continuationToken: string | undefined, ): void { if (typeof page !== "object" || page === null || !continuationToken) { return; diff --git a/sdk/playwrighttesting/arm-playwrighttesting/src/playwrightTestingClient.ts b/sdk/playwrighttesting/arm-playwrighttesting/src/playwrightTestingClient.ts index 506bcec0c878..53c6e9313e6d 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/src/playwrightTestingClient.ts +++ b/sdk/playwrighttesting/arm-playwrighttesting/src/playwrightTestingClient.ts @@ -11,11 +11,21 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PipelineRequest, PipelineResponse, - SendRequest + SendRequest, } from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; -import { OperationsImpl, AccountsImpl, QuotasImpl } from "./operations"; -import { Operations, Accounts, Quotas } from "./operationsInterfaces"; +import { + OperationsImpl, + AccountsImpl, + QuotasImpl, + AccountQuotasImpl, +} from "./operations"; +import { + Operations, + Accounts, + Quotas, + AccountQuotas, +} from "./operationsInterfaces"; import { PlaywrightTestingClientOptionalParams } from "./models"; export class PlaywrightTestingClient extends coreClient.ServiceClient { @@ -26,13 +36,13 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { /** * Initializes a new instance of the PlaywrightTestingClient class. * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param options The parameter options */ constructor( credentials: coreAuth.TokenCredential, subscriptionId: string, - options?: PlaywrightTestingClientOptionalParams + options?: PlaywrightTestingClientOptionalParams, ) { if (credentials === undefined) { throw new Error("'credentials' cannot be null"); @@ -47,7 +57,7 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { } const defaults: PlaywrightTestingClientOptionalParams = { requestContentType: "application/json; charset=utf-8", - credential: credentials + credential: credentials, }; const packageDetails = `azsdk-js-arm-playwrighttesting/1.0.0-beta.3`; @@ -60,20 +70,21 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { ...defaults, ...options, userAgentOptions: { - userAgentPrefix + userAgentPrefix, }, endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com" + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); let bearerTokenAuthenticationPolicyFound: boolean = false; if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies(); + const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = + options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -83,7 +94,7 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { !bearerTokenAuthenticationPolicyFound ) { this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName + name: coreRestPipeline.bearerTokenAuthenticationPolicyName, }); this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ @@ -93,9 +104,9 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge - } - }) + coreClient.authorizeRequestOnClaimChallenge, + }, + }), ); } // Parameter assignments @@ -103,10 +114,11 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-10-01-preview"; + this.apiVersion = options.apiVersion || "2024-08-01-preview"; this.operations = new OperationsImpl(this); this.accounts = new AccountsImpl(this); this.quotas = new QuotasImpl(this); + this.accountQuotas = new AccountQuotasImpl(this); this.addCustomApiVersionPolicy(options.apiVersion); } @@ -119,7 +131,7 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { name: "CustomApiVersionPolicy", async sendRequest( request: PipelineRequest, - next: SendRequest + next: SendRequest, ): Promise { const param = request.url.split("?"); if (param.length > 1) { @@ -133,7 +145,7 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { request.url = param[0] + "?" + newParams.join("&"); } return next(request); - } + }, }; this.pipeline.addPolicy(apiVersionPolicy); } @@ -141,4 +153,5 @@ export class PlaywrightTestingClient extends coreClient.ServiceClient { operations: Operations; accounts: Accounts; quotas: Quotas; + accountQuotas: AccountQuotas; } diff --git a/sdk/playwrighttesting/arm-playwrighttesting/test/playwrighttesting_operations_test.spec.ts b/sdk/playwrighttesting/arm-playwrighttesting/test/playwrighttesting_operations_test.spec.ts deleted file mode 100644 index 8da4fdd51e4c..000000000000 --- a/sdk/playwrighttesting/arm-playwrighttesting/test/playwrighttesting_operations_test.spec.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { PlaywrightTestingClient } from "../src/playwrightTestingClient"; - -const replaceableVariables: Record = { - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("PlaywrightTesting test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: PlaywrightTestingClient; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new PlaywrightTestingClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it("operation list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - }); - -}) diff --git a/sdk/playwrighttesting/arm-playwrighttesting/test/sampleTest.ts b/sdk/playwrighttesting/arm-playwrighttesting/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/playwrighttesting/arm-playwrighttesting/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env, +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id", +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables, +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function (this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function () { + await recorder.stop(); + }); + + it("sample test", async function () { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/playwrighttesting/arm-playwrighttesting/tsconfig.json b/sdk/playwrighttesting/arm-playwrighttesting/tsconfig.json index 4fbccf111a16..3e6ae96443f3 100644 --- a/sdk/playwrighttesting/arm-playwrighttesting/tsconfig.json +++ b/sdk/playwrighttesting/arm-playwrighttesting/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-playwrighttesting": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"