From b0f85856bfd8773bada4e1bd6d653c9b93853fe2 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 3 Feb 2025 16:45:42 +0000 Subject: [PATCH] CodeGen from PR 32020 in Azure/azure-rest-api-specs Merge 1d99413a49b1651119b64547687f4d5c0c42405d into b43042075540b8d67cce7d3d9f70b9b9f5a359da --- ...e.Developer.MicrosoftPlaywrightTesting.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 107 ++ ...loper.MicrosoftPlaywrightTesting.net8.0.cs | 542 +++++++++ ...crosoftPlaywrightTesting.netstandard2.0.cs | 542 +++++++++ ...eveloper.MicrosoftPlaywrightTesting.csproj | 19 + .../src/Generated/AccessLevel.cs | 57 + .../AccountTestRunStats.Serialization.cs | 180 +++ .../src/Generated/AccountTestRunStats.cs | 96 ++ .../src/Generated/AttachmentKind.cs | 54 + .../src/Generated/BrowserType.cs | 54 + .../src/Generated/CiConfig.Serialization.cs | 203 ++++ .../src/Generated/CiConfig.cs | 81 ++ .../src/Generated/CiProviderName.cs | 54 + .../CloudReportingSummary.Serialization.cs | 348 ++++++ .../src/Generated/CloudReportingSummary.cs | 127 ++ .../CloudRunSummary.Serialization.cs | 201 ++++ .../src/Generated/CloudRunSummary.cs | 90 ++ ...laywrightTestingClientBuilderExtensions.cs | 38 + ...rMicrosoftPlaywrightTestingModelFactory.cs | 253 ++++ .../src/Generated/Docs/TestRuns.xml | 491 ++++++++ .../src/Generated/Internal/Argument.cs | 129 ++ .../Internal/ChangeTrackingDictionary.cs | 167 +++ .../Generated/Internal/ChangeTrackingList.cs | 153 +++ .../Internal/ModelSerializationExtensions.cs | 398 +++++++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + .../src/Generated/OsType.cs | 54 + .../PreviousRetrySummary.Serialization.cs | 211 ++++ .../src/Generated/PreviousRetrySummary.cs | 111 ++ .../src/Generated/ReportingClient.cs | 85 ++ .../src/Generated/ReportingClientOptions.cs | 37 + .../Generated/ResultsStats.Serialization.cs | 180 +++ .../src/Generated/ResultsStats.cs | 96 ++ .../src/Generated/RunnerType.cs | 54 + .../Generated/ShardDetails.Serialization.cs | 142 +++ .../src/Generated/ShardDetails.cs | 72 ++ .../Generated/TestFramework.Serialization.cs | 158 +++ .../src/Generated/TestFramework.cs | 87 ++ .../src/Generated/TestFrameworkName.cs | 48 + .../src/Generated/TestRun.Serialization.cs | 290 +++++ .../src/Generated/TestRun.cs | 123 ++ .../Generated/TestRunConfig.Serialization.cs | 241 ++++ .../src/Generated/TestRunConfig.cs | 102 ++ .../src/Generated/TestRunStatus.cs | 54 + .../src/Generated/TestRuns.cs | 1034 +++++++++++++++++ .../TestRunsMetadata.Serialization.cs | 152 +++ .../src/Generated/TestRunsMetadata.cs | 76 ++ .../src/Generated/TestSdkLanguage.cs | 54 + .../src/Generated/TestStatus.cs | 63 + ...ardExecutionStatusRequest.Serialization.cs | 173 +++ .../UpdateShardExecutionStatusRequest.cs | 91 ++ ...dateShardExecutionSummary.Serialization.cs | 165 +++ .../Generated/UpdateShardExecutionSummary.cs | 82 ++ .../UploadBatchRequest.Serialization.cs | 152 +++ .../src/Generated/UploadBatchRequest.cs | 76 ++ .../Generated/UploadMetadata.Serialization.cs | 158 +++ .../src/Generated/UploadMetadata.cs | 84 ++ .../Generated/WebTestConfig.Serialization.cs | 166 +++ .../src/Generated/WebTestConfig.cs | 94 ++ .../src/Properties/AssemblyInfo.cs | 11 + ...er.MicrosoftPlaywrightTesting.Tests.csproj | 20 + .../Generated/Samples/Samples_TestResults.cs | 429 +++++++ .../Generated/Samples/Samples_TestRuns.cs | 505 ++++++++ .../tsp-location.yaml | 5 + 66 files changed, 10298 insertions(+) create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.net8.0.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.netstandard2.0.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessLevel.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AttachmentKind.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/BrowserType.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiProviderName.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/TestRuns.xml create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OsType.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClient.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClientOptions.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/RunnerType.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFrameworkName.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunStatus.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRuns.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestSdkLanguage.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestStatus.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.Serialization.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestResults.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestRuns.cs create mode 100644 sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln new file mode 100644 index 000000000000..f0b95cc94a15 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Azure.Developer.MicrosoftPlaywrightTesting.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.MicrosoftPlaywrightTesting", "src\Azure.Developer.MicrosoftPlaywrightTesting.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.Developer.MicrosoftPlaywrightTesting.Tests", "tests\Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md new file mode 100644 index 000000000000..ba9958c97bb7 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.md @@ -0,0 +1,107 @@ +# Azure.Developer.MicrosoftPlaywrightTesting client library for .NET + +Azure.Developer.MicrosoftPlaywrightTesting is a managed service that helps developers get secret simply and securely. + +Use the client library for to: + +* [Get secret](https://docs.microsoft.com/azure) + +[Source code][source_root] | [Package (NuGet)][package] | [API reference documentation][reference_docs] | [Product documentation][azconfig_docs] | [Samples][source_samples] + + [Source code](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src) | [Package (NuGet)](https://www.nuget.org/packages) | [API reference documentation](https://azure.github.io/azure-sdk-for-net) | [Product documentation](https://docs.microsoft.com/azure) + +## Getting started + +This section should include everything a developer needs to do to install and create their first client connection *very quickly*. + +### Install the package + +First, provide instruction for obtaining and installing the package or library. This section might include only a single line of code, like `dotnet add package package-name`, but should enable a developer to successfully install the package from NuGet, npm, or even cloning a GitHub repository. + +Install the client library for .NET with [NuGet](https://www.nuget.org/ ): + +```dotnetcli +dotnet add package Azure.Developer.MicrosoftPlaywrightTesting --prerelease +``` + +### Prerequisites + +Include a section after the install command that details any requirements that must be satisfied before a developer can [authenticate](#authenticate-the-client) and test all of the snippets in the [Examples](#examples) section. For example, for Cosmos DB: + +> You must have an [Azure subscription](https://azure.microsoft.com/free/dotnet/) and [Cosmos DB account](https://docs.microsoft.com/azure/cosmos-db/account-overview) (SQL API). In order to take advantage of the C# 8.0 syntax, it is recommended that you compile using the [.NET Core SDK](https://dotnet.microsoft.com/download) 3.0 or higher with a [language version](https://docs.microsoft.com/dotnet/csharp/language-reference/configure-language-version#override-a-default) of `latest`. It is also possible to compile with the .NET Core SDK 2.1.x using a language version of `preview`. + +### Authenticate the client + +If your library requires authentication for use, such as for Azure services, include instructions and example code needed for initializing and authenticating. + +For example, include details on obtaining an account key and endpoint URI, setting environment variables for each, and initializing the client object. + +### Service API versions + +The client library targets the latest service API version by default. A client instance accepts an optional service API version parameter from its options to specify which API version service to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when instantiating a client by configuring its associated options. This ensures that the client can communicate with services using the specified API version. + +For example, + +```C# Snippet:CreateClientForSpecificApiVersion +Uri endpoint = new Uri(""); +DefaultAzureCredential credential = new DefaultAzureCredential(); +ClientOptions options = new ClientOptions(ClientOptions.ServiceVersion.) +var client = new Client(endpoint, credential, options); +``` + +When selecting an API version, it's important to verify that there are no breaking changes compared to the latest API version. If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Key concepts + +The *Key concepts* section should describe the functionality of the main classes. Point out the most important and useful classes in the package (with links to their reference pages) and explain how those classes work together. Feel free to use bulleted lists, tables, code blocks, or even diagrams for clarity. + +Include the *Thread safety* and *Additional concepts* sections below at the end of your *Key concepts* section. You may remove or add links depending on what your library makes use of: + +### Thread safety + +We guarantee that all client instance methods are thread-safe and independent of each other ([guideline](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-service-methods-thread-safety)). This ensures that the recommendation of reusing client instances is always safe, even across threads. + +### Additional concepts + +[Client options](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#configuring-service-clients-using-clientoptions) | +[Accessing the response](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#accessing-http-response-details-using-responset) | +[Long-running operations](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#consuming-long-running-operations-using-operationt) | +[Handling failures](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#reporting-errors-requestfailedexception) | +[Diagnostics](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/samples/Diagnostics.md) | +[Mocking](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/core/Azure.Core/README.md#mocking) | +[Client lifetime](https://devblogs.microsoft.com/azure-sdk/lifetime-management-and-thread-safety-guarantees-of-azure-sdk-net-clients/) + + +## Examples + +You can familiarize yourself with different APIs using [Samples](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/samples). + +## Troubleshooting + +Describe common errors and exceptions, how to "unpack" them if necessary, and include guidance for graceful handling and recovery. + +Provide information to help developers avoid throttling or other service-enforced errors they might encounter. For example, provide guidance and examples for using retry or connection policies in the API. + +If the package or a related package supports it, include tips for logging or enabling instrumentation to help them debug their code. + +## Next steps + +* Provide a link to additional code examples, ideally to those sitting alongside the README in the package's `/samples` directory. +* If appropriate, point users to other packages that might be useful. +* If you think there's a good chance that developers might stumble across your package in error (because they're searching for specific functionality and mistakenly think the package provides that functionality), point them to the packages they might be looking for. + +## Contributing + +This is a template, but your SDK readme should include details on how to contribute code to the repo/package. + + +[style-guide-msft]: https://docs.microsoft.com/style-guide/capitalization +[style-guide-cloud]: https://aka.ms/azsdk/cloud-style-guide + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-net/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/README.png) \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.net8.0.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.net8.0.cs new file mode 100644 index 000000000000..bbd385a8a6a1 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.net8.0.cs @@ -0,0 +1,542 @@ +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessLevel(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel Read { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel ReadAddCreateWrite { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel ReadWrite { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel Write { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel left, Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel left, Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AccountTestRunStats : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AccountTestRunStats() { } + public int All { get { throw null; } } + public int CloudExecutionRuns { get { throw null; } } + public int Failed { get { throw null; } } + public int Flaky { get { throw null; } } + public int Passed { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AttachmentKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AttachmentKind(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Image { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Trace { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Video { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind left, Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind left, Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrowserType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrowserType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Chromium { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Firefox { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Webkit { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType left, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.BrowserType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType left, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CiConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CiConfig() { } + public string Author { get { throw null; } set { } } + public string Branch { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName? CiProviderName { get { throw null; } set { } } + public string CommitId { get { throw null; } set { } } + public System.Uri RevisionUrl { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CiConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CiConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CiProviderName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CiProviderName(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName AzureDevOps { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName Default { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName GitHub { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName left, Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName left, Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CloudReportingSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CloudReportingSummary() { } + public System.DateTimeOffset EndTime { get { throw null; } } + public int? FailedTestsCount { get { throw null; } } + public int? FlakyTestsCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Jobs { get { throw null; } } + public int? PassedTestsCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Projects { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerStatus { get { throw null; } } + public int? SkippedTestsCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tags { get { throw null; } } + public int? TotalTestsCount { get { throw null; } } + public int? WorkersCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CloudRunSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CloudRunSummary() { } + public int? BillableTimeInMs { get { throw null; } } + public bool BrowserQuotaExceeded { get { throw null; } } + public int? BrowserSessionsCount { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerStatus { get { throw null; } } + public int? TotalTimeInMs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class DeveloperMicrosoftPlaywrightTestingModelFactory + { + public static Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats AccountTestRunStats(int passed = 0, int failed = 0, int flaky = 0, int all = 0, int cloudExecutionRuns = 0) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary CloudReportingSummary(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus serverStatus = default(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus), int? totalTestsCount = default(int?), int? passedTestsCount = default(int?), int? failedTestsCount = default(int?), int? skippedTestsCount = default(int?), int? flakyTestsCount = default(int?), Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), System.Collections.Generic.IEnumerable jobs = null, System.Collections.Generic.IEnumerable projects = null, System.Collections.Generic.IEnumerable tags = null, int? workersCount = default(int?)) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary CloudRunSummary(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus serverStatus = default(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus), int? billableTimeInMs = default(int?), int? totalTimeInMs = default(int?), int? browserSessionsCount = default(int?), bool browserQuotaExceeded = false) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary PreviousRetrySummary(string testExecutionId = null, int retryCount = 0, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), System.TimeSpan durationInMs = default(System.TimeSpan), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable attachmentsMetadata = null, string artifactsPath = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats ResultsStats(int passed = 0, int failed = 0, int flaky = 0, int skipped = 0, int all = 0) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails TestResultDetails(string testExecutionId = null, string testId = null, string testCombinationId = null, string runId = null, int shardId = 0, string accountId = null, string suiteId = null, string testTitle = null, string suiteTitle = null, string fileName = null, int lineNumber = 0, int retryCount = 0, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig webTestConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.CiConfig ciConfig = null, long durationInMs = (long)0, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable attachmentsMetadata = null, System.Collections.Generic.IEnumerable previousRetries = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable annotations = null, string artifactsPath = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl TestResultsUrl(System.Uri url = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset expiresAt = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel accessLevel = default(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel)) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRun TestRun(string testRunId = null, string displayName = null, System.DateTimeOffset creationTime = default(System.DateTimeOffset), string creatorId = null, string creatorName = null, Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary cloudRunSummary = null, Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary cloudReportSummary = null, Azure.Developer.MicrosoftPlaywrightTesting.CiConfig ciConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig testRunConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl testResultsUrl = null, bool cloudRunEnabled = false, bool cloudReportingEnabled = false) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata TestRunsMetadata(System.Collections.Generic.IEnumerable branches = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary UpdateShardExecutionSummary(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata uploadMetadata = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OsType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Linux { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Mac { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Windows { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.OsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.OsType left, Azure.Developer.MicrosoftPlaywrightTesting.OsType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.OsType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.OsType left, Azure.Developer.MicrosoftPlaywrightTesting.OsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PreviousRetrySummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PreviousRetrySummary() { } + public string ArtifactsPath { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AttachmentsMetadata { get { throw null; } } + public System.TimeSpan DurationInMs { get { throw null; } } + public int RetryCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } } + public string TestExecutionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReportingClient + { + protected ReportingClient() { } + public ReportingClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ReportingClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Developer.MicrosoftPlaywrightTesting.TestResults GetTestResultsClient(string apiVersion = "2025-02-24") { throw null; } + public virtual Azure.Developer.MicrosoftPlaywrightTesting.TestRuns GetTestRunsClient(string apiVersion = "2025-02-24") { throw null; } + } + public partial class ReportingClientOptions : Azure.Core.ClientOptions + { + public ReportingClientOptions(Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions.ServiceVersion version = Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions.ServiceVersion.V2025_02_24) { } + public enum ServiceVersion + { + V2025_02_24 = 1, + } + } + public partial class ResultsStats : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResultsStats() { } + public int All { get { throw null; } } + public int Failed { get { throw null; } } + public int Flaky { get { throw null; } } + public int Passed { get { throw null; } } + public int Skipped { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RunnerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RunnerType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType MsTest { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType Nunit { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType Playwright { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType left, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.RunnerType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType left, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ShardDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ShardDetails(int total) { } + public int Total { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFramework : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestFramework(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName name, string version, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType runnerType) { } + public Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName Name { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.RunnerType RunnerType { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestFramework System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestFramework System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestFrameworkName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestFrameworkName(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName Playwright { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName left, Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName left, Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestResultDetails(string testExecutionId, string testId, string testCombinationId, int shardId, string suiteId, string testTitle, string suiteTitle, string fileName, int lineNumber, int retryCount, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status, long durationInMs, System.DateTimeOffset startTime) { } + public string AccountId { get { throw null; } } + public System.Collections.Generic.IList Annotations { get { throw null; } } + public string ArtifactsPath { get { throw null; } set { } } + public System.Collections.Generic.IList AttachmentsMetadata { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.CiConfig CiConfig { get { throw null; } } + public long DurationInMs { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public int LineNumber { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PreviousRetries { get { throw null; } } + public int RetryCount { get { throw null; } set { } } + public string RunId { get { throw null; } } + public int ShardId { get { throw null; } set { } } + public System.DateTimeOffset StartTime { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } set { } } + public string SuiteId { get { throw null; } set { } } + public string SuiteTitle { get { throw null; } set { } } + public System.Collections.Generic.IList Tags { get { throw null; } } + public string TestCombinationId { get { throw null; } set { } } + public string TestExecutionId { get { throw null; } set { } } + public string TestId { get { throw null; } set { } } + public string TestTitle { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig WebTestConfig { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestResults + { + protected TestResults() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response ComputeResultsStats(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeResultsStats(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeResultsStatsAsync(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeResultsStatsAsync(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTestResultDetails(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTestResultDetails(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTestResultDetailsAsync(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTestResultDetailsAsync(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UploadBatch(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UploadBatch(string accountId, string testRunId, System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UploadBatchAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UploadBatchAsync(string accountId, string testRunId, System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class TestResultsUrl : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestResultsUrl() { } + public Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel AccessLevel { get { throw null; } } + public System.DateTimeOffset CreatedAt { get { throw null; } } + public System.DateTimeOffset ExpiresAt { get { throw null; } } + public System.Uri Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRun : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestRun(string displayName, System.DateTimeOffset creationTime, bool cloudReportingEnabled) { } + public Azure.Developer.MicrosoftPlaywrightTesting.CiConfig CiConfig { get { throw null; } set { } } + public bool CloudReportingEnabled { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary CloudReportSummary { get { throw null; } } + public bool CloudRunEnabled { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary CloudRunSummary { get { throw null; } } + public System.DateTimeOffset CreationTime { get { throw null; } set { } } + public string CreatorId { get { throw null; } } + public string CreatorName { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl TestResultsUrl { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig TestRunConfig { get { throw null; } set { } } + public string TestRunId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRun System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRun System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRunConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestRunConfig(long timeoutInMs, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage testSdkLanguage) { } + public int? RepeatEach { get { throw null; } set { } } + public int? RetryCount { get { throw null; } set { } } + public string ServicePackageVersion { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails ShardDetails { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestFramework TestFramework { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage TestSdkLanguage { get { throw null; } set { } } + public string TestType { get { throw null; } set { } } + public long TimeoutInMs { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRuns + { + protected TestRuns() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response ComputeAccountRunStats(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeAccountRunStats(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeAccountRunStatsAsync(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeAccountRunStatsAsync(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ComputeMetadata(string accountId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeMetadata(string accountId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeMetadataAsync(string accountId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeMetadataAsync(string accountId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdate(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetTestRun(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTestRun(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTestRunAsync(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTestRunAsync(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTestRuns(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTestRuns(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTestRunsAsync(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTestRunsAsync(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateShardExecutionStatus(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateShardExecutionStatus(string accountId, string testRunId, int shardId, Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, int shardId, Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class TestRunsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestRunsMetadata() { } + public System.Collections.Generic.IReadOnlyList Branches { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestRunStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestRunStatus(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ClientComplete { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus Running { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerComplete { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestSdkLanguage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestSdkLanguage(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage CSharp { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage JavaScript { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage TypeScript { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage left, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage left, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestStatus(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Failed { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Flaky { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Interrupted { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Passed { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Skipped { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus TimedOut { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestStatus (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateShardExecutionSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateShardExecutionSummary(System.DateTimeOffset startTime, System.DateTimeOffset endTime) { } + public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata UploadMetadata { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UploadMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UploadMetadata(int testResultsCount, int totalAttachmentsCount, long totalAttachmentsSize) { } + public int TestResultsCount { get { throw null; } } + public int TotalAttachmentsCount { get { throw null; } } + public long TotalAttachmentsSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebTestConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WebTestConfig(string jobName, string projectName, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType browserType, Azure.Developer.MicrosoftPlaywrightTesting.OsType os) { } + public Azure.Developer.MicrosoftPlaywrightTesting.BrowserType BrowserType { get { throw null; } set { } } + public string JobName { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.OsType Os { get { throw null; } set { } } + public string ProjectName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddReportingClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddReportingClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.netstandard2.0.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.netstandard2.0.cs new file mode 100644 index 000000000000..bbd385a8a6a1 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/api/Azure.Developer.MicrosoftPlaywrightTesting.netstandard2.0.cs @@ -0,0 +1,542 @@ +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AccessLevel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AccessLevel(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel Read { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel ReadAddCreateWrite { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel ReadWrite { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel Write { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel left, Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel left, Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AccountTestRunStats : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal AccountTestRunStats() { } + public int All { get { throw null; } } + public int CloudExecutionRuns { get { throw null; } } + public int Failed { get { throw null; } } + public int Flaky { get { throw null; } } + public int Passed { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AttachmentKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AttachmentKind(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Image { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Trace { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind Video { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind left, Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind left, Azure.Developer.MicrosoftPlaywrightTesting.AttachmentKind right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct BrowserType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public BrowserType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Chromium { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Firefox { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.BrowserType Webkit { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType left, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.BrowserType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.BrowserType left, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CiConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CiConfig() { } + public string Author { get { throw null; } set { } } + public string Branch { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName? CiProviderName { get { throw null; } set { } } + public string CommitId { get { throw null; } set { } } + public System.Uri RevisionUrl { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CiConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CiConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CiProviderName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CiProviderName(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName AzureDevOps { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName Default { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName GitHub { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName left, Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName left, Azure.Developer.MicrosoftPlaywrightTesting.CiProviderName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CloudReportingSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CloudReportingSummary() { } + public System.DateTimeOffset EndTime { get { throw null; } } + public int? FailedTestsCount { get { throw null; } } + public int? FlakyTestsCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Jobs { get { throw null; } } + public int? PassedTestsCount { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Projects { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerStatus { get { throw null; } } + public int? SkippedTestsCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tags { get { throw null; } } + public int? TotalTestsCount { get { throw null; } } + public int? WorkersCount { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CloudRunSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CloudRunSummary() { } + public int? BillableTimeInMs { get { throw null; } } + public bool BrowserQuotaExceeded { get { throw null; } } + public int? BrowserSessionsCount { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerStatus { get { throw null; } } + public int? TotalTimeInMs { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public static partial class DeveloperMicrosoftPlaywrightTestingModelFactory + { + public static Azure.Developer.MicrosoftPlaywrightTesting.AccountTestRunStats AccountTestRunStats(int passed = 0, int failed = 0, int flaky = 0, int all = 0, int cloudExecutionRuns = 0) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary CloudReportingSummary(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus serverStatus = default(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus), int? totalTestsCount = default(int?), int? passedTestsCount = default(int?), int? failedTestsCount = default(int?), int? skippedTestsCount = default(int?), int? flakyTestsCount = default(int?), Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), System.Collections.Generic.IEnumerable jobs = null, System.Collections.Generic.IEnumerable projects = null, System.Collections.Generic.IEnumerable tags = null, int? workersCount = default(int?)) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary CloudRunSummary(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus serverStatus = default(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus), int? billableTimeInMs = default(int?), int? totalTimeInMs = default(int?), int? browserSessionsCount = default(int?), bool browserQuotaExceeded = false) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary PreviousRetrySummary(string testExecutionId = null, int retryCount = 0, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), System.TimeSpan durationInMs = default(System.TimeSpan), System.DateTimeOffset startTime = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable attachmentsMetadata = null, string artifactsPath = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats ResultsStats(int passed = 0, int failed = 0, int flaky = 0, int skipped = 0, int all = 0) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails TestResultDetails(string testExecutionId = null, string testId = null, string testCombinationId = null, string runId = null, int shardId = 0, string accountId = null, string suiteId = null, string testTitle = null, string suiteTitle = null, string fileName = null, int lineNumber = 0, int retryCount = 0, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status = default(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus), Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig webTestConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.CiConfig ciConfig = null, long durationInMs = (long)0, System.DateTimeOffset startTime = default(System.DateTimeOffset), System.Collections.Generic.IEnumerable attachmentsMetadata = null, System.Collections.Generic.IEnumerable previousRetries = null, System.Collections.Generic.IEnumerable tags = null, System.Collections.Generic.IEnumerable annotations = null, string artifactsPath = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl TestResultsUrl(System.Uri url = null, System.DateTimeOffset createdAt = default(System.DateTimeOffset), System.DateTimeOffset expiresAt = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel accessLevel = default(Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel)) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRun TestRun(string testRunId = null, string displayName = null, System.DateTimeOffset creationTime = default(System.DateTimeOffset), string creatorId = null, string creatorName = null, Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary cloudRunSummary = null, Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary cloudReportSummary = null, Azure.Developer.MicrosoftPlaywrightTesting.CiConfig ciConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig testRunConfig = null, Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl testResultsUrl = null, bool cloudRunEnabled = false, bool cloudReportingEnabled = false) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata TestRunsMetadata(System.Collections.Generic.IEnumerable branches = null) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary UpdateShardExecutionSummary(System.DateTimeOffset startTime = default(System.DateTimeOffset), System.DateTimeOffset endTime = default(System.DateTimeOffset), Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata uploadMetadata = null) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OsType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Linux { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Mac { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.OsType Windows { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.OsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.OsType left, Azure.Developer.MicrosoftPlaywrightTesting.OsType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.OsType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.OsType left, Azure.Developer.MicrosoftPlaywrightTesting.OsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PreviousRetrySummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PreviousRetrySummary() { } + public string ArtifactsPath { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AttachmentsMetadata { get { throw null; } } + public System.TimeSpan DurationInMs { get { throw null; } } + public int RetryCount { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } } + public string TestExecutionId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.PreviousRetrySummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ReportingClient + { + protected ReportingClient() { } + public ReportingClient(System.Uri endpoint, Azure.Core.TokenCredential credential) { } + public ReportingClient(System.Uri endpoint, Azure.Core.TokenCredential credential, Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions options) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Developer.MicrosoftPlaywrightTesting.TestResults GetTestResultsClient(string apiVersion = "2025-02-24") { throw null; } + public virtual Azure.Developer.MicrosoftPlaywrightTesting.TestRuns GetTestRunsClient(string apiVersion = "2025-02-24") { throw null; } + } + public partial class ReportingClientOptions : Azure.Core.ClientOptions + { + public ReportingClientOptions(Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions.ServiceVersion version = Azure.Developer.MicrosoftPlaywrightTesting.ReportingClientOptions.ServiceVersion.V2025_02_24) { } + public enum ServiceVersion + { + V2025_02_24 = 1, + } + } + public partial class ResultsStats : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ResultsStats() { } + public int All { get { throw null; } } + public int Failed { get { throw null; } } + public int Flaky { get { throw null; } } + public int Passed { get { throw null; } } + public int Skipped { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ResultsStats System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct RunnerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public RunnerType(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType MsTest { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType Nunit { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.RunnerType Playwright { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType left, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.RunnerType (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.RunnerType left, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ShardDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ShardDetails(int total) { } + public int Total { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFramework : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestFramework(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName name, string version, Azure.Developer.MicrosoftPlaywrightTesting.RunnerType runnerType) { } + public Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName Name { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.RunnerType RunnerType { get { throw null; } set { } } + public string Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestFramework System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestFramework System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestFrameworkName : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestFrameworkName(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName Playwright { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName left, Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName left, Azure.Developer.MicrosoftPlaywrightTesting.TestFrameworkName right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TestResultDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestResultDetails(string testExecutionId, string testId, string testCombinationId, int shardId, string suiteId, string testTitle, string suiteTitle, string fileName, int lineNumber, int retryCount, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus status, long durationInMs, System.DateTimeOffset startTime) { } + public string AccountId { get { throw null; } } + public System.Collections.Generic.IList Annotations { get { throw null; } } + public string ArtifactsPath { get { throw null; } set { } } + public System.Collections.Generic.IList AttachmentsMetadata { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.CiConfig CiConfig { get { throw null; } } + public long DurationInMs { get { throw null; } set { } } + public string FileName { get { throw null; } set { } } + public int LineNumber { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList PreviousRetries { get { throw null; } } + public int RetryCount { get { throw null; } set { } } + public string RunId { get { throw null; } } + public int ShardId { get { throw null; } set { } } + public System.DateTimeOffset StartTime { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Status { get { throw null; } set { } } + public string SuiteId { get { throw null; } set { } } + public string SuiteTitle { get { throw null; } set { } } + public System.Collections.Generic.IList Tags { get { throw null; } } + public string TestCombinationId { get { throw null; } set { } } + public string TestExecutionId { get { throw null; } set { } } + public string TestId { get { throw null; } set { } } + public string TestTitle { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig WebTestConfig { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestResults + { + protected TestResults() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response ComputeResultsStats(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeResultsStats(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeResultsStatsAsync(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeResultsStatsAsync(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTestResultDetails(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTestResultDetails(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTestResultDetailsAsync(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTestResultDetailsAsync(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UploadBatch(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UploadBatch(string accountId, string testRunId, System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UploadBatchAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UploadBatchAsync(string accountId, string testRunId, System.Collections.Generic.IEnumerable values, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class TestResultsUrl : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestResultsUrl() { } + public Azure.Developer.MicrosoftPlaywrightTesting.AccessLevel AccessLevel { get { throw null; } } + public System.DateTimeOffset CreatedAt { get { throw null; } } + public System.DateTimeOffset ExpiresAt { get { throw null; } } + public System.Uri Url { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRun : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestRun(string displayName, System.DateTimeOffset creationTime, bool cloudReportingEnabled) { } + public Azure.Developer.MicrosoftPlaywrightTesting.CiConfig CiConfig { get { throw null; } set { } } + public bool CloudReportingEnabled { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.CloudReportingSummary CloudReportSummary { get { throw null; } } + public bool CloudRunEnabled { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.CloudRunSummary CloudRunSummary { get { throw null; } } + public System.DateTimeOffset CreationTime { get { throw null; } set { } } + public string CreatorId { get { throw null; } } + public string CreatorName { get { throw null; } } + public string DisplayName { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestResultsUrl TestResultsUrl { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig TestRunConfig { get { throw null; } set { } } + public string TestRunId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRun System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRun System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRunConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TestRunConfig(long timeoutInMs, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage testSdkLanguage) { } + public int? RepeatEach { get { throw null; } set { } } + public int? RetryCount { get { throw null; } set { } } + public string ServicePackageVersion { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.ShardDetails ShardDetails { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestFramework TestFramework { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage TestSdkLanguage { get { throw null; } set { } } + public string TestType { get { throw null; } set { } } + public long TimeoutInMs { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestRuns + { + protected TestRuns() { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response ComputeAccountRunStats(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeAccountRunStats(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeAccountRunStatsAsync(string accountId, int? top, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeAccountRunStatsAsync(string accountId, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response ComputeMetadata(string accountId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response ComputeMetadata(string accountId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ComputeMetadataAsync(string accountId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> ComputeMetadataAsync(string accountId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response CreateOrUpdate(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateOrUpdateAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetTestRun(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual Azure.Response GetTestRun(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task GetTestRunAsync(string accountId, string testRunId, Azure.RequestContext context) { throw null; } + public virtual System.Threading.Tasks.Task> GetTestRunAsync(string accountId, string testRunId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetTestRuns(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.Pageable GetTestRuns(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetTestRunsAsync(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, Azure.RequestContext context) { throw null; } + public virtual Azure.AsyncPageable GetTestRunsAsync(string accountId, int? maxCount = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), string filter = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response UpdateShardExecutionStatus(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateShardExecutionStatus(string accountId, string testRunId, int shardId, Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, int shardId, Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class TestRunsMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestRunsMetadata() { } + public System.Collections.Generic.IReadOnlyList Branches { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.TestRunsMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestRunStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestRunStatus(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ClientComplete { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus Running { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus ServerComplete { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestRunStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestSdkLanguage : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestSdkLanguage(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage CSharp { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage JavaScript { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage TypeScript { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage left, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage left, Azure.Developer.MicrosoftPlaywrightTesting.TestSdkLanguage right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TestStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TestStatus(string value) { throw null; } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Failed { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Flaky { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Interrupted { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Passed { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus Skipped { get { throw null; } } + public static Azure.Developer.MicrosoftPlaywrightTesting.TestStatus TimedOut { get { throw null; } } + public bool Equals(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus right) { throw null; } + public static implicit operator Azure.Developer.MicrosoftPlaywrightTesting.TestStatus (string value) { throw null; } + public static bool operator !=(Azure.Developer.MicrosoftPlaywrightTesting.TestStatus left, Azure.Developer.MicrosoftPlaywrightTesting.TestStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class UpdateShardExecutionSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UpdateShardExecutionSummary(System.DateTimeOffset startTime, System.DateTimeOffset endTime) { } + public System.DateTimeOffset EndTime { get { throw null; } } + public System.DateTimeOffset StartTime { get { throw null; } } + public Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata UploadMetadata { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UpdateShardExecutionSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class UploadMetadata : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public UploadMetadata(int testResultsCount, int totalAttachmentsCount, long totalAttachmentsSize) { } + public int TestResultsCount { get { throw null; } } + public int TotalAttachmentsCount { get { throw null; } } + public long TotalAttachmentsSize { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.UploadMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebTestConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public WebTestConfig(string jobName, string projectName, Azure.Developer.MicrosoftPlaywrightTesting.BrowserType browserType, Azure.Developer.MicrosoftPlaywrightTesting.OsType os) { } + public Azure.Developer.MicrosoftPlaywrightTesting.BrowserType BrowserType { get { throw null; } set { } } + public string JobName { get { throw null; } set { } } + public Azure.Developer.MicrosoftPlaywrightTesting.OsType Os { get { throw null; } set { } } + public string ProjectName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.Developer.MicrosoftPlaywrightTesting.WebTestConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Microsoft.Extensions.Azure +{ + public static partial class DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions + { + public static Azure.Core.Extensions.IAzureClientBuilder AddReportingClient(this TBuilder builder, System.Uri endpoint) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential { throw null; } + public static Azure.Core.Extensions.IAzureClientBuilder AddReportingClient(this TBuilder builder, TConfiguration configuration) where TBuilder : Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration { throw null; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj new file mode 100644 index 000000000000..4a68b892e00d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Azure.Developer.MicrosoftPlaywrightTesting.csproj @@ -0,0 +1,19 @@ + + + This is the Azure.Developer.MicrosoftPlaywrightTesting client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.Developer.MicrosoftPlaywrightTesting for Azure Data Plane + 1.0.0-beta.1 + Azure.Developer.MicrosoftPlaywrightTesting + $(RequiredTargetFrameworks) + true + + + + + + + + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessLevel.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessLevel.cs new file mode 100644 index 000000000000..10ecfee6dcfa --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccessLevel.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Access levels for test results URL. + public readonly partial struct AccessLevel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessLevel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadValue = "Read"; + private const string WriteValue = "Write"; + private const string ReadWriteValue = "ReadWrite"; + private const string ReadAddCreateWriteValue = "ReadAddCreateWrite"; + + /// Read access. + public static AccessLevel Read { get; } = new AccessLevel(ReadValue); + /// Write access. + public static AccessLevel Write { get; } = new AccessLevel(WriteValue); + /// Read and write access. + public static AccessLevel ReadWrite { get; } = new AccessLevel(ReadWriteValue); + /// Read, add, create, and write access. + public static AccessLevel ReadAddCreateWrite { get; } = new AccessLevel(ReadAddCreateWriteValue); + /// Determines if two values are the same. + public static bool operator ==(AccessLevel left, AccessLevel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessLevel left, AccessLevel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccessLevel(string value) => new AccessLevel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessLevel other && Equals(other); + /// + public bool Equals(AccessLevel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.Serialization.cs new file mode 100644 index 000000000000..e1df7b6f77b1 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class AccountTestRunStats : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountTestRunStats)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("passed"u8); + writer.WriteNumberValue(Passed); + writer.WritePropertyName("failed"u8); + writer.WriteNumberValue(Failed); + writer.WritePropertyName("flaky"u8); + writer.WriteNumberValue(Flaky); + writer.WritePropertyName("all"u8); + writer.WriteNumberValue(All); + writer.WritePropertyName("cloudExecutionRuns"u8); + writer.WriteNumberValue(CloudExecutionRuns); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AccountTestRunStats IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AccountTestRunStats)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAccountTestRunStats(document.RootElement, options); + } + + internal static AccountTestRunStats DeserializeAccountTestRunStats(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int passed = default; + int failed = default; + int flaky = default; + int all = default; + int cloudExecutionRuns = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("passed"u8)) + { + passed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failed"u8)) + { + failed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("flaky"u8)) + { + flaky = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("all"u8)) + { + all = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("cloudExecutionRuns"u8)) + { + cloudExecutionRuns = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AccountTestRunStats( + passed, + failed, + flaky, + all, + cloudExecutionRuns, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AccountTestRunStats)} does not support writing '{options.Format}' format."); + } + } + + AccountTestRunStats IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAccountTestRunStats(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AccountTestRunStats)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static AccountTestRunStats FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeAccountTestRunStats(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.cs new file mode 100644 index 000000000000..d9f1430ad837 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AccountTestRunStats.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Summary statistics of Testrun in an account. + public partial class AccountTestRunStats + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Passed runs within an account. + /// Failed runs within an account. + /// Flaky runs within an account. + /// Total runs within an account. + /// Cloud Executed runs within an account. + internal AccountTestRunStats(int passed, int failed, int flaky, int all, int cloudExecutionRuns) + { + Passed = passed; + Failed = failed; + Flaky = flaky; + All = all; + CloudExecutionRuns = cloudExecutionRuns; + } + + /// Initializes a new instance of . + /// Passed runs within an account. + /// Failed runs within an account. + /// Flaky runs within an account. + /// Total runs within an account. + /// Cloud Executed runs within an account. + /// Keeps track of any properties unknown to the library. + internal AccountTestRunStats(int passed, int failed, int flaky, int all, int cloudExecutionRuns, IDictionary serializedAdditionalRawData) + { + Passed = passed; + Failed = failed; + Flaky = flaky; + All = all; + CloudExecutionRuns = cloudExecutionRuns; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AccountTestRunStats() + { + } + + /// Passed runs within an account. + public int Passed { get; } + /// Failed runs within an account. + public int Failed { get; } + /// Flaky runs within an account. + public int Flaky { get; } + /// Total runs within an account. + public int All { get; } + /// Cloud Executed runs within an account. + public int CloudExecutionRuns { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AttachmentKind.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AttachmentKind.cs new file mode 100644 index 000000000000..7b5a9efeae2e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/AttachmentKind.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Attachment kinds uploaded for a test result. + public readonly partial struct AttachmentKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AttachmentKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ImageValue = "Image"; + private const string VideoValue = "Video"; + private const string TraceValue = "Trace"; + + /// Screenshot. + public static AttachmentKind Image { get; } = new AttachmentKind(ImageValue); + /// Video. + public static AttachmentKind Video { get; } = new AttachmentKind(VideoValue); + /// Trace. + public static AttachmentKind Trace { get; } = new AttachmentKind(TraceValue); + /// Determines if two values are the same. + public static bool operator ==(AttachmentKind left, AttachmentKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AttachmentKind left, AttachmentKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AttachmentKind(string value) => new AttachmentKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AttachmentKind other && Equals(other); + /// + public bool Equals(AttachmentKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/BrowserType.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/BrowserType.cs new file mode 100644 index 000000000000..01d7bc436660 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/BrowserType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported browser Types for tests. + public readonly partial struct BrowserType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public BrowserType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ChromiumValue = "Chromium"; + private const string WebkitValue = "Webkit"; + private const string FirefoxValue = "Firefox"; + + /// Chromium. + public static BrowserType Chromium { get; } = new BrowserType(ChromiumValue); + /// Webkit. + public static BrowserType Webkit { get; } = new BrowserType(WebkitValue); + /// Firefox. + public static BrowserType Firefox { get; } = new BrowserType(FirefoxValue); + /// Determines if two values are the same. + public static bool operator ==(BrowserType left, BrowserType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(BrowserType left, BrowserType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator BrowserType(string value) => new BrowserType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is BrowserType other && Equals(other); + /// + public bool Equals(BrowserType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.Serialization.cs new file mode 100644 index 000000000000..6661c97ac477 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.Serialization.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class CiConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CiConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CiProviderName)) + { + writer.WritePropertyName("ciProviderName"u8); + writer.WriteStringValue(CiProviderName.Value.ToString()); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"u8); + writer.WriteStringValue(Branch); + } + if (Optional.IsDefined(Author)) + { + writer.WritePropertyName("author"u8); + writer.WriteStringValue(Author); + } + if (Optional.IsDefined(CommitId)) + { + writer.WritePropertyName("commitId"u8); + writer.WriteStringValue(CommitId); + } + if (Optional.IsDefined(RevisionUrl)) + { + writer.WritePropertyName("revisionUrl"u8); + writer.WriteStringValue(RevisionUrl.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CiConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CiConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCiConfig(document.RootElement, options); + } + + internal static CiConfig DeserializeCiConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CiProviderName? ciProviderName = default; + string branch = default; + string author = default; + string commitId = default; + Uri revisionUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ciProviderName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ciProviderName = new CiProviderName(property.Value.GetString()); + continue; + } + if (property.NameEquals("branch"u8)) + { + branch = property.Value.GetString(); + continue; + } + if (property.NameEquals("author"u8)) + { + author = property.Value.GetString(); + continue; + } + if (property.NameEquals("commitId"u8)) + { + commitId = property.Value.GetString(); + continue; + } + if (property.NameEquals("revisionUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + revisionUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CiConfig( + ciProviderName, + branch, + author, + commitId, + revisionUrl, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CiConfig)} does not support writing '{options.Format}' format."); + } + } + + CiConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCiConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CiConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CiConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCiConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.cs new file mode 100644 index 000000000000..353fece56885 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiConfig.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing continuous integration (CI) configuration. + public partial class CiConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CiConfig() + { + } + + /// Initializes a new instance of . + /// Name of the CI provider. GitHub | Azure DevOps | Default. + /// Branch name in the source code repository. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Author of the commit triggering the test run. All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// ID of the commit triggering the test run. This is the SHA-1 hash. + /// URL linking to the revision details. Should be a valid Url. Allowed characters- alphanumeric characters (A-Z, a-z, 0-9), hyphens (-), underscores (_), periods (.), tildes (~), and forward slashes (/) for hierarchy. Special characters must be URL-encoded. + /// Keeps track of any properties unknown to the library. + internal CiConfig(CiProviderName? ciProviderName, string branch, string author, string commitId, Uri revisionUrl, IDictionary serializedAdditionalRawData) + { + CiProviderName = ciProviderName; + Branch = branch; + Author = author; + CommitId = commitId; + RevisionUrl = revisionUrl; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Name of the CI provider. GitHub | Azure DevOps | Default. + public CiProviderName? CiProviderName { get; set; } + /// Branch name in the source code repository. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string Branch { get; set; } + /// Author of the commit triggering the test run. All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string Author { get; set; } + /// ID of the commit triggering the test run. This is the SHA-1 hash. + public string CommitId { get; set; } + /// URL linking to the revision details. Should be a valid Url. Allowed characters- alphanumeric characters (A-Z, a-z, 0-9), hyphens (-), underscores (_), periods (.), tildes (~), and forward slashes (/) for hierarchy. Special characters must be URL-encoded. + public Uri RevisionUrl { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiProviderName.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiProviderName.cs new file mode 100644 index 000000000000..72a069692355 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CiProviderName.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported CI provider for tests. + public readonly partial struct CiProviderName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CiProviderName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GitHubValue = "GitHub"; + private const string AzureDevOpsValue = "Azure DevOps"; + private const string DefaultValue = "Default"; + + /// GitHub. + public static CiProviderName GitHub { get; } = new CiProviderName(GitHubValue); + /// Azure DevOps. + public static CiProviderName AzureDevOps { get; } = new CiProviderName(AzureDevOpsValue); + /// default. + public static CiProviderName Default { get; } = new CiProviderName(DefaultValue); + /// Determines if two values are the same. + public static bool operator ==(CiProviderName left, CiProviderName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CiProviderName left, CiProviderName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CiProviderName(string value) => new CiProviderName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CiProviderName other && Equals(other); + /// + public bool Equals(CiProviderName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.Serialization.cs new file mode 100644 index 000000000000..b484e85f6c9e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.Serialization.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class CloudReportingSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudReportingSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime, "O"); + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime, "O"); + writer.WritePropertyName("serverStatus"u8); + writer.WriteStringValue(ServerStatus.ToString()); + if (options.Format != "W" && Optional.IsDefined(TotalTestsCount)) + { + writer.WritePropertyName("totalTestsCount"u8); + writer.WriteNumberValue(TotalTestsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(PassedTestsCount)) + { + writer.WritePropertyName("passedTestsCount"u8); + writer.WriteNumberValue(PassedTestsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(FailedTestsCount)) + { + writer.WritePropertyName("failedTestsCount"u8); + writer.WriteNumberValue(FailedTestsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(SkippedTestsCount)) + { + writer.WritePropertyName("skippedTestsCount"u8); + writer.WriteNumberValue(SkippedTestsCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(FlakyTestsCount)) + { + writer.WritePropertyName("flakyTestsCount"u8); + writer.WriteNumberValue(FlakyTestsCount.Value); + } + if (options.Format != "W") + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Jobs)) + { + writer.WritePropertyName("jobs"u8); + writer.WriteStartArray(); + foreach (var item in Jobs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Projects)) + { + writer.WritePropertyName("projects"u8); + writer.WriteStartArray(); + foreach (var item in Projects) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartArray(); + foreach (var item in Tags) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(WorkersCount)) + { + writer.WritePropertyName("workersCount"u8); + writer.WriteNumberValue(WorkersCount.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CloudReportingSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudReportingSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudReportingSummary(document.RootElement, options); + } + + internal static CloudReportingSummary DeserializeCloudReportingSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + DateTimeOffset endTime = default; + TestRunStatus serverStatus = default; + int? totalTestsCount = default; + int? passedTestsCount = default; + int? failedTestsCount = default; + int? skippedTestsCount = default; + int? flakyTestsCount = default; + TestStatus status = default; + IReadOnlyList jobs = default; + IReadOnlyList projects = default; + IReadOnlyList tags = default; + int? workersCount = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("serverStatus"u8)) + { + serverStatus = new TestRunStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("totalTestsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalTestsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("passedTestsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + passedTestsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failedTestsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedTestsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("skippedTestsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + skippedTestsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("flakyTestsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + flakyTestsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new TestStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("jobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + jobs = array; + continue; + } + if (property.NameEquals("projects"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + projects = array; + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + tags = array; + continue; + } + if (property.NameEquals("workersCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + workersCount = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudReportingSummary( + startTime, + endTime, + serverStatus, + totalTestsCount, + passedTestsCount, + failedTestsCount, + skippedTestsCount, + flakyTestsCount, + status, + jobs ?? new ChangeTrackingList(), + projects ?? new ChangeTrackingList(), + tags ?? new ChangeTrackingList(), + workersCount, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudReportingSummary)} does not support writing '{options.Format}' format."); + } + } + + CloudReportingSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCloudReportingSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudReportingSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CloudReportingSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCloudReportingSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.cs new file mode 100644 index 000000000000..ed3740b87e0f --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudReportingSummary.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing summary of test run results. + public partial class CloudReportingSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + /// Processing Status of the testresults on the Server Side. + internal CloudReportingSummary(DateTimeOffset startTime, DateTimeOffset endTime, TestRunStatus serverStatus) + { + StartTime = startTime; + EndTime = endTime; + ServerStatus = serverStatus; + Jobs = new ChangeTrackingList(); + Projects = new ChangeTrackingList(); + Tags = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + /// Processing Status of the testresults on the Server Side. + /// Total number of tests executed. + /// Number of tests that passed. + /// Number of tests that failed. + /// Number of tests that were skipped. + /// Number of tests that were flaky (passed on retry). + /// Status of the test run. + /// List of CI jobs associated with the test run. + /// List of Playwright projects (https://playwright.dev/docs/test-projects) associated with the test run. + /// List of tags associated with the test run. + /// Number of worker instances. + /// Keeps track of any properties unknown to the library. + internal CloudReportingSummary(DateTimeOffset startTime, DateTimeOffset endTime, TestRunStatus serverStatus, int? totalTestsCount, int? passedTestsCount, int? failedTestsCount, int? skippedTestsCount, int? flakyTestsCount, TestStatus status, IReadOnlyList jobs, IReadOnlyList projects, IReadOnlyList tags, int? workersCount, IDictionary serializedAdditionalRawData) + { + StartTime = startTime; + EndTime = endTime; + ServerStatus = serverStatus; + TotalTestsCount = totalTestsCount; + PassedTestsCount = passedTestsCount; + FailedTestsCount = failedTestsCount; + SkippedTestsCount = skippedTestsCount; + FlakyTestsCount = flakyTestsCount; + Status = status; + Jobs = jobs; + Projects = projects; + Tags = tags; + WorkersCount = workersCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudReportingSummary() + { + } + + /// Start time of the test run in datetime(RFC 3339 literal format). + public DateTimeOffset StartTime { get; } + /// End time of the test run. + public DateTimeOffset EndTime { get; } + /// Processing Status of the testresults on the Server Side. + public TestRunStatus ServerStatus { get; } + /// Total number of tests executed. + public int? TotalTestsCount { get; } + /// Number of tests that passed. + public int? PassedTestsCount { get; } + /// Number of tests that failed. + public int? FailedTestsCount { get; } + /// Number of tests that were skipped. + public int? SkippedTestsCount { get; } + /// Number of tests that were flaky (passed on retry). + public int? FlakyTestsCount { get; } + /// Status of the test run. + public TestStatus Status { get; } + /// List of CI jobs associated with the test run. + public IReadOnlyList Jobs { get; } + /// List of Playwright projects (https://playwright.dev/docs/test-projects) associated with the test run. + public IReadOnlyList Projects { get; } + /// List of tags associated with the test run. + public IReadOnlyList Tags { get; } + /// Number of worker instances. + public int? WorkersCount { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.Serialization.cs new file mode 100644 index 000000000000..a04dcf25ba0a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class CloudRunSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudRunSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("serverStatus"u8); + writer.WriteStringValue(ServerStatus.ToString()); + if (Optional.IsDefined(BillableTimeInMs)) + { + writer.WritePropertyName("billableTimeInMs"u8); + writer.WriteNumberValue(BillableTimeInMs.Value); + } + if (Optional.IsDefined(TotalTimeInMs)) + { + writer.WritePropertyName("totalTimeInMs"u8); + writer.WriteNumberValue(TotalTimeInMs.Value); + } + if (Optional.IsDefined(BrowserSessionsCount)) + { + writer.WritePropertyName("browserSessionsCount"u8); + writer.WriteNumberValue(BrowserSessionsCount.Value); + } + writer.WritePropertyName("browserQuotaExceeded"u8); + writer.WriteBooleanValue(BrowserQuotaExceeded); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CloudRunSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CloudRunSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCloudRunSummary(document.RootElement, options); + } + + internal static CloudRunSummary DeserializeCloudRunSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TestRunStatus serverStatus = default; + int? billableTimeInMs = default; + int? totalTimeInMs = default; + int? browserSessionsCount = default; + bool browserQuotaExceeded = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("serverStatus"u8)) + { + serverStatus = new TestRunStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("billableTimeInMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + billableTimeInMs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalTimeInMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + totalTimeInMs = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("browserSessionsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + browserSessionsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("browserQuotaExceeded"u8)) + { + browserQuotaExceeded = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CloudRunSummary( + serverStatus, + billableTimeInMs, + totalTimeInMs, + browserSessionsCount, + browserQuotaExceeded, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CloudRunSummary)} does not support writing '{options.Format}' format."); + } + } + + CloudRunSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCloudRunSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CloudRunSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static CloudRunSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeCloudRunSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.cs new file mode 100644 index 000000000000..4d7550d2ef6f --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/CloudRunSummary.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing summary information about a test run. + public partial class CloudRunSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Status of the test run. Allowed values: RUNNING | CLIENT_COMPLETE | SERVER_COMPLETE. + /// Flag indicating whether the test run was throttled due to reaching the maximum allowed parallel browser limit for the workspace. + internal CloudRunSummary(TestRunStatus serverStatus, bool browserQuotaExceeded) + { + ServerStatus = serverStatus; + BrowserQuotaExceeded = browserQuotaExceeded; + } + + /// Initializes a new instance of . + /// Status of the test run. Allowed values: RUNNING | CLIENT_COMPLETE | SERVER_COMPLETE. + /// Billable time for the test run. Available after testRun Ends. + /// Total time taken for the test run. + /// Number of browser sessions used in the test run. + /// Flag indicating whether the test run was throttled due to reaching the maximum allowed parallel browser limit for the workspace. + /// Keeps track of any properties unknown to the library. + internal CloudRunSummary(TestRunStatus serverStatus, int? billableTimeInMs, int? totalTimeInMs, int? browserSessionsCount, bool browserQuotaExceeded, IDictionary serializedAdditionalRawData) + { + ServerStatus = serverStatus; + BillableTimeInMs = billableTimeInMs; + TotalTimeInMs = totalTimeInMs; + BrowserSessionsCount = browserSessionsCount; + BrowserQuotaExceeded = browserQuotaExceeded; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CloudRunSummary() + { + } + + /// Status of the test run. Allowed values: RUNNING | CLIENT_COMPLETE | SERVER_COMPLETE. + public TestRunStatus ServerStatus { get; } + /// Billable time for the test run. Available after testRun Ends. + public int? BillableTimeInMs { get; } + /// Total time taken for the test run. + public int? TotalTimeInMs { get; } + /// Number of browser sessions used in the test run. + public int? BrowserSessionsCount { get; } + /// Flag indicating whether the test run was throttled due to reaching the maximum allowed parallel browser limit for the workspace. + public bool BrowserQuotaExceeded { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs new file mode 100644 index 000000000000..a040ce57a633 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core.Extensions; +using Azure.Developer.MicrosoftPlaywrightTesting; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class DeveloperMicrosoftPlaywrightTestingClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.reporting.api.playwright.microsoft.com). + /// + public static IAzureClientBuilder AddReportingClient(this TBuilder builder, Uri endpoint) + where TBuilder : IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory((options, cred) => new ReportingClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static IAzureClientBuilder AddReportingClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory(configuration); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs new file mode 100644 index 000000000000..10fa15741b26 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/DeveloperMicrosoftPlaywrightTestingModelFactory.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model factory for models. + public static partial class DeveloperMicrosoftPlaywrightTestingModelFactory + { + /// Initializes a new instance of . + /// Identifier of the test execution. Should be a guid. + /// Identifier of the test. + /// Identifier of the test combination.This is SHA-1 hash. + /// Identifier of the test run. + /// Identifier of the shard. + /// Identifier of the account. + /// Identifier of the suite. + /// Title of the test. All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Title of the suite. All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Name of the file- subject to constraints of OS and programming language. + /// Line number. + /// Number of retryCount attempts. Max retryCount is 100, after which testresults metadata will not be stored. + /// Status of the test result. While uploading results, a single test execution status can't be Flaky. + /// Configuration for the web test. + /// Continuous integration configuration. + /// Duration of the test execution in milliseconds. + /// Start time of the test execution.- (RFC 3339 literal format). + /// Metadata related to attachments- comma separated IMAGE, VIDEO, TRACE as applicable. + /// Previous retry summaries. While uploading results, each retry is uploaded separately.However, all the retries of a test gets grouped on the server side and can be retrieved as a single entity using GET API. + /// List of tags associated with the test result. All unicode characters except ASCII control characters, special characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// List of annotations (https://playwright.dev/docs/test-annotations).All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Relative path in storage for all the artifacts of this test. contain only lowercase letters, numbers, and hyphens, and cannot start or end with a hyphen or contain consecutive hyphens. + /// A new instance for mocking. + public static TestResultDetails TestResultDetails(string testExecutionId = null, string testId = null, string testCombinationId = null, string runId = null, int shardId = default, string accountId = null, string suiteId = null, string testTitle = null, string suiteTitle = null, string fileName = null, int lineNumber = default, int retryCount = default, TestStatus status = default, WebTestConfig webTestConfig = null, CiConfig ciConfig = null, long durationInMs = default, DateTimeOffset startTime = default, IEnumerable attachmentsMetadata = null, IEnumerable previousRetries = null, IEnumerable tags = null, IEnumerable annotations = null, string artifactsPath = null) + { + attachmentsMetadata ??= new List(); + previousRetries ??= new List(); + tags ??= new List(); + annotations ??= new List(); + + return new TestResultDetails( + testExecutionId, + testId, + testCombinationId, + runId, + shardId, + accountId, + suiteId, + testTitle, + suiteTitle, + fileName, + lineNumber, + retryCount, + status, + webTestConfig, + ciConfig, + durationInMs, + startTime, + attachmentsMetadata?.ToList(), + previousRetries?.ToList(), + tags?.ToList(), + annotations?.ToList(), + artifactsPath, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Identifier of the test execution. + /// Number of retryCount attempts. + /// Status of the test execution. + /// Duration of the test execution. + /// Start time of the test execution- RFC 3339 literal format. + /// Metadata related to attachments. + /// List of artifacts paths. + /// A new instance for mocking. + public static PreviousRetrySummary PreviousRetrySummary(string testExecutionId = null, int retryCount = default, TestStatus status = default, TimeSpan durationInMs = default, DateTimeOffset startTime = default, IEnumerable attachmentsMetadata = null, string artifactsPath = null) + { + attachmentsMetadata ??= new List(); + + return new PreviousRetrySummary( + testExecutionId, + retryCount, + status, + durationInMs, + startTime, + attachmentsMetadata?.ToList(), + artifactsPath, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Passed test-results within a run. + /// Failed tests within a run. + /// Flaky tests within a run. + /// Skipped tests within a run. + /// Total tests within a run. + /// A new instance for mocking. + public static ResultsStats ResultsStats(int passed = default, int failed = default, int flaky = default, int skipped = default, int all = default) + { + return new ResultsStats( + passed, + failed, + flaky, + skipped, + all, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Display name of the test run All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Creation time of the test run -RFC 3339 literal format. + /// Creator's identifier. It's the Id referred in the access/Entra token. + /// Creator's name. + /// Summary of the Cloud executed run. Only available if cloud run is enabled. + /// Summary of reports uploaded on cloud. Only available if cloud reporting is enabled. + /// Continuous integration configuration. + /// Client configuration for the test run. + /// URL for accessing test results. + /// Flag indicating if cloud run is enabled. + /// Must be set to true when users want to use Reporting Feature. + /// A new instance for mocking. + public static TestRun TestRun(string testRunId = null, string displayName = null, DateTimeOffset creationTime = default, string creatorId = null, string creatorName = null, CloudRunSummary cloudRunSummary = null, CloudReportingSummary cloudReportSummary = null, CiConfig ciConfig = null, TestRunConfig testRunConfig = null, TestResultsUrl testResultsUrl = null, bool cloudRunEnabled = default, bool cloudReportingEnabled = default) + { + return new TestRun( + testRunId, + displayName, + creationTime, + creatorId, + creatorName, + cloudRunSummary, + cloudReportSummary, + ciConfig, + testRunConfig, + testResultsUrl, + cloudRunEnabled, + cloudReportingEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Status of the test run. Allowed values: RUNNING | CLIENT_COMPLETE | SERVER_COMPLETE. + /// Billable time for the test run. Available after testRun Ends. + /// Total time taken for the test run. + /// Number of browser sessions used in the test run. + /// Flag indicating whether the test run was throttled due to reaching the maximum allowed parallel browser limit for the workspace. + /// A new instance for mocking. + public static CloudRunSummary CloudRunSummary(TestRunStatus serverStatus = default, int? billableTimeInMs = null, int? totalTimeInMs = null, int? browserSessionsCount = null, bool browserQuotaExceeded = default) + { + return new CloudRunSummary( + serverStatus, + billableTimeInMs, + totalTimeInMs, + browserSessionsCount, + browserQuotaExceeded, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + /// Processing Status of the testresults on the Server Side. + /// Total number of tests executed. + /// Number of tests that passed. + /// Number of tests that failed. + /// Number of tests that were skipped. + /// Number of tests that were flaky (passed on retry). + /// Status of the test run. + /// List of CI jobs associated with the test run. + /// List of Playwright projects (https://playwright.dev/docs/test-projects) associated with the test run. + /// List of tags associated with the test run. + /// Number of worker instances. + /// A new instance for mocking. + public static CloudReportingSummary CloudReportingSummary(DateTimeOffset startTime = default, DateTimeOffset endTime = default, TestRunStatus serverStatus = default, int? totalTestsCount = null, int? passedTestsCount = null, int? failedTestsCount = null, int? skippedTestsCount = null, int? flakyTestsCount = null, TestStatus status = default, IEnumerable jobs = null, IEnumerable projects = null, IEnumerable tags = null, int? workersCount = null) + { + jobs ??= new List(); + projects ??= new List(); + tags ??= new List(); + + return new CloudReportingSummary( + startTime, + endTime, + serverStatus, + totalTestsCount, + passedTestsCount, + failedTestsCount, + skippedTestsCount, + flakyTestsCount, + status, + jobs?.ToList(), + projects?.ToList(), + tags?.ToList(), + workersCount, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// URL for accessing test results. + /// Creation timestamp of the test results URL- RFC 3339 literal format. + /// Expiration timestamp of the test results URL- RFC 3339 literal format. + /// Access level for the test results URL. + /// A new instance for mocking. + public static TestResultsUrl TestResultsUrl(Uri url = null, DateTimeOffset createdAt = default, DateTimeOffset expiresAt = default, AccessLevel accessLevel = default) + { + return new TestResultsUrl(url, createdAt, expiresAt, accessLevel, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + /// Metadata related to test run uploads. + /// A new instance for mocking. + public static UpdateShardExecutionSummary UpdateShardExecutionSummary(DateTimeOffset startTime = default, DateTimeOffset endTime = default, UploadMetadata uploadMetadata = null) + { + return new UpdateShardExecutionSummary(startTime, endTime, uploadMetadata, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Passed runs within an account. + /// Failed runs within an account. + /// Flaky runs within an account. + /// Total runs within an account. + /// Cloud Executed runs within an account. + /// A new instance for mocking. + public static AccountTestRunStats AccountTestRunStats(int passed = default, int failed = default, int flaky = default, int all = default, int cloudExecutionRuns = default) + { + return new AccountTestRunStats( + passed, + failed, + flaky, + all, + cloudExecutionRuns, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of CI branches for a testrun, All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// A new instance for mocking. + public static TestRunsMetadata TestRunsMetadata(IEnumerable branches = null) + { + branches ??= new List(); + + return new TestRunsMetadata(branches?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/TestRuns.xml b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/TestRuns.xml new file mode 100644 index 000000000000..d27bbf326615 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Docs/TestRuns.xml @@ -0,0 +1,491 @@ + + + + + +This sample shows how to call CreateOrUpdateAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Sample Test Run", + creationTime = "2024-09-28T12:32:33Z", + ciConfig = new + { + branch = "main", + author = "John Doe", + revisionUrl = "https://github.com/azure-rest-api-specs/1234", + }, + testRunConfig = new + { + retryCount = 3, + repeatEach = 5000, + testFramework = new + { + name = "Playwright", + version = "3.1.0", + runnerType = "Nunit", + }, + shardDetails = new + { + total = 5, + }, + timeoutInMs = 60000L, + testType = "WebTest", + testSdkLanguage = "JavaScript", + servicePackageVersion = "1.0.0-beta.4", + }, + cloudReportingEnabled = false, +}); +Response response = await client.CreateOrUpdateAsync("4eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("testRunId").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("creatorId").ToString()); +Console.WriteLine(result.GetProperty("creatorName").ToString()); +Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); +Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +]]> + + + +This sample shows how to call CreateOrUpdate and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +using RequestContent content = RequestContent.Create(new +{ + displayName = "Sample Test Run", + creationTime = "2024-09-28T12:32:33Z", + ciConfig = new + { + branch = "main", + author = "John Doe", + revisionUrl = "https://github.com/azure-rest-api-specs/1234", + }, + testRunConfig = new + { + retryCount = 3, + repeatEach = 5000, + testFramework = new + { + name = "Playwright", + version = "3.1.0", + runnerType = "Nunit", + }, + shardDetails = new + { + total = 5, + }, + timeoutInMs = 60000L, + testType = "WebTest", + testSdkLanguage = "JavaScript", + servicePackageVersion = "1.0.0-beta.4", + }, + cloudReportingEnabled = false, +}); +Response response = client.CreateOrUpdate("4eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("testRunId").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("creatorId").ToString()); +Console.WriteLine(result.GetProperty("creatorName").ToString()); +Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); +Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +]]> + + + +This sample shows how to call GetTestRunAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.GetTestRunAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); +]]> + + + +This sample shows how to call GetTestRun. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.GetTestRun("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); +]]> + + + +This sample shows how to call GetTestRunAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.GetTestRunAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("testRunId").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("creatorId").ToString()); +Console.WriteLine(result.GetProperty("creatorName").ToString()); +Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); +Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +]]> + + + +This sample shows how to call GetTestRun and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.GetTestRun("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("testRunId").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("creationTime").ToString()); +Console.WriteLine(result.GetProperty("creatorId").ToString()); +Console.WriteLine(result.GetProperty("creatorName").ToString()); +Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); +Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +]]> + + + +This sample shows how to call CreateArtifactsUploadBaseUrlAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.CreateArtifactsUploadBaseUrlAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); +]]> + + + +This sample shows how to call CreateArtifactsUploadBaseUrl. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.CreateArtifactsUploadBaseUrl("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); +]]> + + + +This sample shows how to call CreateArtifactsUploadBaseUrlAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.CreateArtifactsUploadBaseUrlAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("accessLevel").ToString()); +]]> + + + +This sample shows how to call CreateArtifactsUploadBaseUrl and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.CreateArtifactsUploadBaseUrl("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("url").ToString()); +Console.WriteLine(result.GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("expiresAt").ToString()); +Console.WriteLine(result.GetProperty("accessLevel").ToString()); +]]> + + + +This sample shows how to call UpdateShardExecutionStatusAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +UpdateShardExecutionSummary summary = new UpdateShardExecutionSummary(DateTimeOffset.Parse("8819-10-30T18:52:21Z"), DateTimeOffset.Parse("6230-12-03T14:22:58Z")) +{ + UploadMetadata = new UploadMetadata(100, 100, 48200L), +}; +Response response = await client.UpdateShardExecutionStatusAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", 1, summary, 5); +]]> + + + +This sample shows how to call UpdateShardExecutionStatus. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +UpdateShardExecutionSummary summary = new UpdateShardExecutionSummary(DateTimeOffset.Parse("8819-10-30T18:52:21Z"), DateTimeOffset.Parse("6230-12-03T14:22:58Z")) +{ + UploadMetadata = new UploadMetadata(100, 100, 48200L), +}; +Response response = client.UpdateShardExecutionStatus("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", 1, summary, 5); +]]> + + + +This sample shows how to call UpdateShardExecutionStatusAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +using RequestContent content = RequestContent.Create(new +{ + shardId = 1, + workersCount = 5, + uploadCompleted = true, + summary = new + { + startTime = "8819-10-30T18:52:21Z", + endTime = "6230-12-03T14:22:58Z", + uploadMetadata = new + { + testResultsCount = 100, + totalAttachmentsCount = 100, + totalAttachmentsSize = 48200L, + }, + }, +}); +Response response = await client.UpdateShardExecutionStatusAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call UpdateShardExecutionStatus. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +using RequestContent content = RequestContent.Create(new +{ + shardId = 1, + workersCount = 5, + uploadCompleted = true, + summary = new + { + startTime = "8819-10-30T18:52:21Z", + endTime = "6230-12-03T14:22:58Z", + uploadMetadata = new + { + testResultsCount = 100, + totalAttachmentsCount = 100, + totalAttachmentsSize = 48200L, + }, + }, +}); +Response response = client.UpdateShardExecutionStatus("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call ComputeAccountRunStatsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.ComputeAccountRunStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); +]]> + + + +This sample shows how to call ComputeAccountRunStats. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.ComputeAccountRunStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); +]]> + + + +This sample shows how to call ComputeAccountRunStatsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.ComputeAccountRunStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", 10, 0, 50, "status eq 'FAILED'", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("passed").ToString()); +Console.WriteLine(result.GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("flaky").ToString()); +Console.WriteLine(result.GetProperty("all").ToString()); +Console.WriteLine(result.GetProperty("cloudExecutionRuns").ToString()); +]]> + + + +This sample shows how to call ComputeAccountRunStats and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.ComputeAccountRunStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", 10, 0, 50, "status eq 'FAILED'", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("passed").ToString()); +Console.WriteLine(result.GetProperty("failed").ToString()); +Console.WriteLine(result.GetProperty("flaky").ToString()); +Console.WriteLine(result.GetProperty("all").ToString()); +Console.WriteLine(result.GetProperty("cloudExecutionRuns").ToString()); +]]> + + + +This sample shows how to call ComputeMetadataAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.ComputeMetadataAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); +]]> + + + +This sample shows how to call ComputeMetadata. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.ComputeMetadata("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); +]]> + + + +This sample shows how to call ComputeMetadataAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = await client.ComputeMetadataAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("branches")[0].ToString()); +]]> + + + +This sample shows how to call ComputeMetadata and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +Response response = client.ComputeMetadata("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("branches")[0].ToString()); +]]> + + + +This sample shows how to call GetTestRunsAsync. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +await foreach (TestRun item in client.GetTestRunsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) +{ +} +]]> + + + +This sample shows how to call GetTestRuns. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +foreach (TestRun item in client.GetTestRuns("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) +{ +} +]]> + + + +This sample shows how to call GetTestRunsAsync and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +await foreach (BinaryData item in client.GetTestRunsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +} +]]> + + + +This sample shows how to call GetTestRuns and parse the result. +"); +TokenCredential credential = new DefaultAzureCredential(); +TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + +foreach (BinaryData item in client.GetTestRuns("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..751c33a54e9a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..f1d970892926 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..19167552757e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..8eea5e0eb9ac --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/ModelSerializationExtensions.cs @@ -0,0 +1,398 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.Text.Json; +using System.Xml; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class ModelSerializationExtensions + { + internal static readonly ModelReaderWriterOptions WireOptions = new ModelReaderWriterOptions("W"); + + public static object GetObject(this JsonElement element) + { + switch (element.ValueKind) + { + case JsonValueKind.String: + return element.GetString(); + case JsonValueKind.Number: + if (element.TryGetInt32(out int intValue)) + { + return intValue; + } + if (element.TryGetInt64(out long longValue)) + { + return longValue; + } + return element.GetDouble(); + case JsonValueKind.True: + return true; + case JsonValueKind.False: + return false; + case JsonValueKind.Undefined: + case JsonValueKind.Null: + return null; + case JsonValueKind.Object: + var dictionary = new Dictionary(); + foreach (var jsonProperty in element.EnumerateObject()) + { + dictionary.Add(jsonProperty.Name, jsonProperty.Value.GetObject()); + } + return dictionary; + case JsonValueKind.Array: + var list = new List(); + foreach (var item in element.EnumerateArray()) + { + list.Add(item.GetObject()); + } + return list.ToArray(); + default: + throw new NotSupportedException($"Not supported value kind {element.ValueKind}"); + } + } + + public static byte[] GetBytesFromBase64(this JsonElement element, string format) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + + return format switch + { + "U" => TypeFormatters.FromBase64UrlString(element.GetRequiredString()), + "D" => element.GetBytesFromBase64(), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + } + + public static DateTimeOffset GetDateTimeOffset(this JsonElement element, string format) => format switch + { + "U" when element.ValueKind == JsonValueKind.Number => DateTimeOffset.FromUnixTimeSeconds(element.GetInt64()), + _ => TypeFormatters.ParseDateTimeOffset(element.GetString(), format) + }; + + public static TimeSpan GetTimeSpan(this JsonElement element, string format) => TypeFormatters.ParseTimeSpan(element.GetString(), format); + + public static char GetChar(this JsonElement element) + { + if (element.ValueKind == JsonValueKind.String) + { + var text = element.GetString(); + if (text == null || text.Length != 1) + { + throw new NotSupportedException($"Cannot convert \"{text}\" to a char"); + } + return text[0]; + } + else + { + throw new NotSupportedException($"Cannot convert {element.ValueKind} to a char"); + } + } + + [Conditional("DEBUG")] + public static void ThrowNonNullablePropertyIsNull(this JsonProperty property) + { + throw new JsonException($"A property '{property.Name}' defined as non-nullable but received as null from the service. This exception only happens in DEBUG builds of the library and would be ignored in the release build"); + } + + public static string GetRequiredString(this JsonElement element) + { + var value = element.GetString(); + if (value == null) + { + throw new InvalidOperationException($"The requested operation requires an element of type 'String', but the target element has type '{element.ValueKind}'."); + } + return value; + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, DateTime value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, TimeSpan value, string format) + { + writer.WriteStringValue(TypeFormatters.ToString(value, format)); + } + + public static void WriteStringValue(this Utf8JsonWriter writer, char value) + { + writer.WriteStringValue(value.ToString(CultureInfo.InvariantCulture)); + } + + public static void WriteBase64StringValue(this Utf8JsonWriter writer, byte[] value, string format) + { + if (value == null) + { + writer.WriteNullValue(); + return; + } + switch (format) + { + case "U": + writer.WriteStringValue(TypeFormatters.ToBase64UrlString(value)); + break; + case "D": + writer.WriteBase64StringValue(value); + break; + default: + throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)); + } + } + + public static void WriteNumberValue(this Utf8JsonWriter writer, DateTimeOffset value, string format) + { + if (format != "U") + { + throw new ArgumentOutOfRangeException(nameof(format), "Only 'U' format is supported when writing a DateTimeOffset as a Number."); + } + writer.WriteNumberValue(value.ToUnixTimeSeconds()); + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, T value, ModelReaderWriterOptions options = null) + { + switch (value) + { + case null: + writer.WriteNullValue(); + break; + case IJsonModel jsonModel: + jsonModel.Write(writer, options ?? WireOptions); + break; + case IUtf8JsonSerializable serializable: + serializable.Write(writer); + break; + case byte[] bytes: + writer.WriteBase64StringValue(bytes); + break; + case BinaryData bytes0: + writer.WriteBase64StringValue(bytes0); + break; + case JsonElement json: + json.WriteTo(writer); + break; + case int i: + writer.WriteNumberValue(i); + break; + case decimal d: + writer.WriteNumberValue(d); + break; + case double d0: + if (double.IsNaN(d0)) + { + writer.WriteStringValue("NaN"); + } + else + { + writer.WriteNumberValue(d0); + } + break; + case float f: + writer.WriteNumberValue(f); + break; + case long l: + writer.WriteNumberValue(l); + break; + case string s: + writer.WriteStringValue(s); + break; + case bool b: + writer.WriteBooleanValue(b); + break; + case Guid g: + writer.WriteStringValue(g); + break; + case DateTimeOffset dateTimeOffset: + writer.WriteStringValue(dateTimeOffset, "O"); + break; + case DateTime dateTime: + writer.WriteStringValue(dateTime, "O"); + break; + case IEnumerable> enumerable: + writer.WriteStartObject(); + foreach (var pair in enumerable) + { + writer.WritePropertyName(pair.Key); + writer.WriteObjectValue(pair.Value, options); + } + writer.WriteEndObject(); + break; + case IEnumerable objectEnumerable: + writer.WriteStartArray(); + foreach (var item in objectEnumerable) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + break; + case TimeSpan timeSpan: + writer.WriteStringValue(timeSpan, "P"); + break; + default: + throw new NotSupportedException($"Not supported type {value.GetType()}"); + } + } + + public static void WriteObjectValue(this Utf8JsonWriter writer, object value, ModelReaderWriterOptions options = null) + { + writer.WriteObjectValue(value, options); + } + + internal static class TypeFormatters + { + private const string RoundtripZFormat = "yyyy-MM-ddTHH:mm:ss.fffffffZ"; + public const string DefaultNumberFormat = "G"; + + public static string ToString(bool value) => value ? "true" : "false"; + + public static string ToString(DateTime value, string format) => value.Kind switch + { + DateTimeKind.Utc => ToString((DateTimeOffset)value, format), + _ => throw new NotSupportedException($"DateTime {value} has a Kind of {value.Kind}. Azure SDK requires it to be UTC. You can call DateTime.SpecifyKind to change Kind property value to DateTimeKind.Utc.") + }; + + public static string ToString(DateTimeOffset value, string format) => format switch + { + "D" => value.ToString("yyyy-MM-dd", CultureInfo.InvariantCulture), + "U" => value.ToUnixTimeSeconds().ToString(CultureInfo.InvariantCulture), + "O" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "o" => value.ToUniversalTime().ToString(RoundtripZFormat, CultureInfo.InvariantCulture), + "R" => value.ToString("r", CultureInfo.InvariantCulture), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(TimeSpan value, string format) => format switch + { + "P" => XmlConvert.ToString(value), + _ => value.ToString(format, CultureInfo.InvariantCulture) + }; + + public static string ToString(byte[] value, string format) => format switch + { + "U" => ToBase64UrlString(value), + "D" => Convert.ToBase64String(value), + _ => throw new ArgumentException($"Format is not supported: '{format}'", nameof(format)) + }; + + public static string ToBase64UrlString(byte[] value) + { + int numWholeOrPartialInputBlocks = checked(value.Length + 2) / 3; + int size = checked(numWholeOrPartialInputBlocks * 4); + char[] output = new char[size]; + + int numBase64Chars = Convert.ToBase64CharArray(value, 0, value.Length, output, 0); + + int i = 0; + for (; i < numBase64Chars; i++) + { + char ch = output[i]; + if (ch == '+') + { + output[i] = '-'; + } + else + { + if (ch == '/') + { + output[i] = '_'; + } + else + { + if (ch == '=') + { + break; + } + } + } + } + + return new string(output, 0, i); + } + + public static byte[] FromBase64UrlString(string value) + { + int paddingCharsToAdd = (value.Length % 4) switch + { + 0 => 0, + 2 => 2, + 3 => 1, + _ => throw new InvalidOperationException("Malformed input") + }; + char[] output = new char[(value.Length + paddingCharsToAdd)]; + int i = 0; + for (; i < value.Length; i++) + { + char ch = value[i]; + if (ch == '-') + { + output[i] = '+'; + } + else + { + if (ch == '_') + { + output[i] = '/'; + } + else + { + output[i] = ch; + } + } + } + + for (; i < output.Length; i++) + { + output[i] = '='; + } + + return Convert.FromBase64CharArray(output, 0, output.Length); + } + + public static DateTimeOffset ParseDateTimeOffset(string value, string format) => format switch + { + "U" => DateTimeOffset.FromUnixTimeSeconds(long.Parse(value, CultureInfo.InvariantCulture)), + _ => DateTimeOffset.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal) + }; + + public static TimeSpan ParseTimeSpan(string value, string format) => format switch + { + "P" => XmlConvert.ToTimeSpan(value), + _ => TimeSpan.ParseExact(value, format, CultureInfo.InvariantCulture) + }; + + public static string ConvertToString(object value, string format = null) => value switch + { + null => "null", + string s => s, + bool b => ToString(b), + int or float or double or long or decimal => ((IFormattable)value).ToString(DefaultNumberFormat, CultureInfo.InvariantCulture), + byte[] b0 when format != null => ToString(b0, format), + IEnumerable s0 => string.Join(",", s0), + DateTimeOffset dateTime when format != null => ToString(dateTime, format), + TimeSpan timeSpan when format != null => ToString(timeSpan, format), + TimeSpan timeSpan0 => XmlConvert.ToString(timeSpan0), + Guid guid => guid.ToString(), + BinaryData binaryData => ConvertToString(binaryData.ToArray(), format), + _ => value.ToString() + }; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..aeefc5cf26a9 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..56ddcc549b34 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OsType.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OsType.cs new file mode 100644 index 000000000000..c7e0b403ed80 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/OsType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported OS for tests. + public readonly partial struct OsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + private const string MacValue = "Mac"; + + /// Windows. + public static OsType Windows { get; } = new OsType(WindowsValue); + /// Linux. + public static OsType Linux { get; } = new OsType(LinuxValue); + /// Macintosh. + public static OsType Mac { get; } = new OsType(MacValue); + /// Determines if two values are the same. + public static bool operator ==(OsType left, OsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OsType left, OsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OsType(string value) => new OsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OsType other && Equals(other); + /// + public bool Equals(OsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.Serialization.cs new file mode 100644 index 000000000000..d294a71d76d5 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class PreviousRetrySummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PreviousRetrySummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("testExecutionId"u8); + writer.WriteStringValue(TestExecutionId); + writer.WritePropertyName("retryCount"u8); + writer.WriteNumberValue(RetryCount); + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.ToString()); + writer.WritePropertyName("durationInMs"u8); + writer.WriteStringValue(DurationInMs, "P"); + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime, "O"); + writer.WritePropertyName("attachmentsMetadata"u8); + writer.WriteStartArray(); + foreach (var item in AttachmentsMetadata) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(ArtifactsPath)) + { + writer.WritePropertyName("artifactsPath"u8); + writer.WriteStringValue(ArtifactsPath); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PreviousRetrySummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PreviousRetrySummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePreviousRetrySummary(document.RootElement, options); + } + + internal static PreviousRetrySummary DeserializePreviousRetrySummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string testExecutionId = default; + int retryCount = default; + TestStatus status = default; + TimeSpan durationInMs = default; + DateTimeOffset startTime = default; + IReadOnlyList attachmentsMetadata = default; + string artifactsPath = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("testExecutionId"u8)) + { + testExecutionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("retryCount"u8)) + { + retryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new TestStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("durationInMs"u8)) + { + durationInMs = property.Value.GetTimeSpan("P"); + continue; + } + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("attachmentsMetadata"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AttachmentKind(item.GetString())); + } + attachmentsMetadata = array; + continue; + } + if (property.NameEquals("artifactsPath"u8)) + { + artifactsPath = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PreviousRetrySummary( + testExecutionId, + retryCount, + status, + durationInMs, + startTime, + attachmentsMetadata, + artifactsPath, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PreviousRetrySummary)} does not support writing '{options.Format}' format."); + } + } + + PreviousRetrySummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializePreviousRetrySummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PreviousRetrySummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static PreviousRetrySummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializePreviousRetrySummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.cs new file mode 100644 index 000000000000..75447e830667 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/PreviousRetrySummary.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Summary of previous retries. + public partial class PreviousRetrySummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Identifier of the test execution. + /// Number of retryCount attempts. + /// Status of the test execution. + /// Duration of the test execution. + /// Start time of the test execution- RFC 3339 literal format. + /// Metadata related to attachments. + /// or is null. + internal PreviousRetrySummary(string testExecutionId, int retryCount, TestStatus status, TimeSpan durationInMs, DateTimeOffset startTime, IEnumerable attachmentsMetadata) + { + Argument.AssertNotNull(testExecutionId, nameof(testExecutionId)); + Argument.AssertNotNull(attachmentsMetadata, nameof(attachmentsMetadata)); + + TestExecutionId = testExecutionId; + RetryCount = retryCount; + Status = status; + DurationInMs = durationInMs; + StartTime = startTime; + AttachmentsMetadata = attachmentsMetadata.ToList(); + } + + /// Initializes a new instance of . + /// Identifier of the test execution. + /// Number of retryCount attempts. + /// Status of the test execution. + /// Duration of the test execution. + /// Start time of the test execution- RFC 3339 literal format. + /// Metadata related to attachments. + /// List of artifacts paths. + /// Keeps track of any properties unknown to the library. + internal PreviousRetrySummary(string testExecutionId, int retryCount, TestStatus status, TimeSpan durationInMs, DateTimeOffset startTime, IReadOnlyList attachmentsMetadata, string artifactsPath, IDictionary serializedAdditionalRawData) + { + TestExecutionId = testExecutionId; + RetryCount = retryCount; + Status = status; + DurationInMs = durationInMs; + StartTime = startTime; + AttachmentsMetadata = attachmentsMetadata; + ArtifactsPath = artifactsPath; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PreviousRetrySummary() + { + } + + /// Identifier of the test execution. + public string TestExecutionId { get; } + /// Number of retryCount attempts. + public int RetryCount { get; } + /// Status of the test execution. + public TestStatus Status { get; } + /// Duration of the test execution. + public TimeSpan DurationInMs { get; } + /// Start time of the test execution- RFC 3339 literal format. + public DateTimeOffset StartTime { get; } + /// Metadata related to attachments. + public IReadOnlyList AttachmentsMetadata { get; } + /// List of artifacts paths. + public string ArtifactsPath { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClient.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClient.cs new file mode 100644 index 000000000000..e41604255b5a --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + // Data plane generated client. + /// The Reporting service client. + public partial class ReportingClient + { + private static readonly string[] AuthorizationScopes = new string[] { "https://playwright.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of ReportingClient for mocking. + protected ReportingClient() + { + } + + /// Initializes a new instance of ReportingClient. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.reporting.api.playwright.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// or is null. + public ReportingClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new ReportingClientOptions()) + { + } + + /// Initializes a new instance of ReportingClient. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.reporting.api.playwright.microsoft.com). + /// + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public ReportingClient(Uri endpoint, TokenCredential credential, ReportingClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ReportingClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of TestRuns. + /// The API version to use for this operation. + /// is null. + public virtual TestRuns GetTestRunsClient(string apiVersion = "2025-02-24") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new TestRuns(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of TestResults. + /// The API version to use for this operation. + /// is null. + public virtual TestResults GetTestResultsClient(string apiVersion = "2025-02-24") + { + Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new TestResults(ClientDiagnostics, _pipeline, _tokenCredential, _endpoint, apiVersion); + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClientOptions.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClientOptions.cs new file mode 100644 index 000000000000..18fc3b55f2d0 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ReportingClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Client options for ReportingClient. + public partial class ReportingClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2025_02_24; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2025-02-24". + V2025_02_24 = 1, + } + + internal string Version { get; } + + /// Initializes new instance of ReportingClientOptions. + public ReportingClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2025_02_24 => "2025-02-24", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.Serialization.cs new file mode 100644 index 000000000000..5d5cb6f6297e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class ResultsStats : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResultsStats)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("passed"u8); + writer.WriteNumberValue(Passed); + writer.WritePropertyName("failed"u8); + writer.WriteNumberValue(Failed); + writer.WritePropertyName("flaky"u8); + writer.WriteNumberValue(Flaky); + writer.WritePropertyName("skipped"u8); + writer.WriteNumberValue(Skipped); + writer.WritePropertyName("all"u8); + writer.WriteNumberValue(All); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ResultsStats IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResultsStats)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResultsStats(document.RootElement, options); + } + + internal static ResultsStats DeserializeResultsStats(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int passed = default; + int failed = default; + int flaky = default; + int skipped = default; + int all = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("passed"u8)) + { + passed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failed"u8)) + { + failed = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("flaky"u8)) + { + flaky = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("skipped"u8)) + { + skipped = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("all"u8)) + { + all = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResultsStats( + passed, + failed, + flaky, + skipped, + all, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ResultsStats)} does not support writing '{options.Format}' format."); + } + } + + ResultsStats IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeResultsStats(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResultsStats)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ResultsStats FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeResultsStats(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.cs new file mode 100644 index 000000000000..757f65e2c2e2 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ResultsStats.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Summary statistics of testresults in a run. + public partial class ResultsStats + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Passed test-results within a run. + /// Failed tests within a run. + /// Flaky tests within a run. + /// Skipped tests within a run. + /// Total tests within a run. + internal ResultsStats(int passed, int failed, int flaky, int skipped, int all) + { + Passed = passed; + Failed = failed; + Flaky = flaky; + Skipped = skipped; + All = all; + } + + /// Initializes a new instance of . + /// Passed test-results within a run. + /// Failed tests within a run. + /// Flaky tests within a run. + /// Skipped tests within a run. + /// Total tests within a run. + /// Keeps track of any properties unknown to the library. + internal ResultsStats(int passed, int failed, int flaky, int skipped, int all, IDictionary serializedAdditionalRawData) + { + Passed = passed; + Failed = failed; + Flaky = flaky; + Skipped = skipped; + All = all; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResultsStats() + { + } + + /// Passed test-results within a run. + public int Passed { get; } + /// Failed tests within a run. + public int Failed { get; } + /// Flaky tests within a run. + public int Flaky { get; } + /// Skipped tests within a run. + public int Skipped { get; } + /// Total tests within a run. + public int All { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/RunnerType.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/RunnerType.cs new file mode 100644 index 000000000000..0b29864b507e --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/RunnerType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported Runner Types for tests. + public readonly partial struct RunnerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public RunnerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MsTestValue = "MsTest"; + private const string NunitValue = "Nunit"; + private const string PlaywrightValue = "Playwright"; + + /// MsTest. + public static RunnerType MsTest { get; } = new RunnerType(MsTestValue); + /// Nunit. + public static RunnerType Nunit { get; } = new RunnerType(NunitValue); + /// Playwright. + public static RunnerType Playwright { get; } = new RunnerType(PlaywrightValue); + /// Determines if two values are the same. + public static bool operator ==(RunnerType left, RunnerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(RunnerType left, RunnerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator RunnerType(string value) => new RunnerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is RunnerType other && Equals(other); + /// + public bool Equals(RunnerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.Serialization.cs new file mode 100644 index 000000000000..a157c0087a1d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class ShardDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShardDetails)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("total"u8); + writer.WriteNumberValue(Total); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ShardDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ShardDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeShardDetails(document.RootElement, options); + } + + internal static ShardDetails DeserializeShardDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int total = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("total"u8)) + { + total = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ShardDetails(total, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ShardDetails)} does not support writing '{options.Format}' format."); + } + } + + ShardDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeShardDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ShardDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static ShardDetails FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeShardDetails(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.cs new file mode 100644 index 000000000000..4976f364a406 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/ShardDetails.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing a shard. Learn about Playwright sharding here: https://playwright.dev/docs/test-sharding. + public partial class ShardDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Total number of shards. + public ShardDetails(int total) + { + Total = total; + } + + /// Initializes a new instance of . + /// Total number of shards. + /// Keeps track of any properties unknown to the library. + internal ShardDetails(int total, IDictionary serializedAdditionalRawData) + { + Total = total; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ShardDetails() + { + } + + /// Total number of shards. + public int Total { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.Serialization.cs new file mode 100644 index 000000000000..cb94c4fa2937 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class TestFramework : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFramework)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.ToString()); + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + writer.WritePropertyName("runnerType"u8); + writer.WriteStringValue(RunnerType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TestFramework IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFramework)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFramework(document.RootElement, options); + } + + internal static TestFramework DeserializeTestFramework(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TestFrameworkName name = default; + string version = default; + RunnerType runnerType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = new TestFrameworkName(property.Value.GetString()); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("runnerType"u8)) + { + runnerType = new RunnerType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFramework(name, version, runnerType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestFramework)} does not support writing '{options.Format}' format."); + } + } + + TestFramework IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestFramework(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFramework)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TestFramework FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTestFramework(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.cs new file mode 100644 index 000000000000..ed0392e5eb46 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFramework.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing a test framework. + public partial class TestFramework + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the test framework. Supported Frameworks are Playwright. + /// Version of the test framework. + /// Name of the test runner.Supported Frameworks are MSTEST, Playwright, NUNIT. + /// is null. + public TestFramework(TestFrameworkName name, string version, RunnerType runnerType) + { + Argument.AssertNotNull(version, nameof(version)); + + Name = name; + Version = version; + RunnerType = runnerType; + } + + /// Initializes a new instance of . + /// Name of the test framework. Supported Frameworks are Playwright. + /// Version of the test framework. + /// Name of the test runner.Supported Frameworks are MSTEST, Playwright, NUNIT. + /// Keeps track of any properties unknown to the library. + internal TestFramework(TestFrameworkName name, string version, RunnerType runnerType, IDictionary serializedAdditionalRawData) + { + Name = name; + Version = version; + RunnerType = runnerType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TestFramework() + { + } + + /// Name of the test framework. Supported Frameworks are Playwright. + public TestFrameworkName Name { get; set; } + /// Version of the test framework. + public string Version { get; set; } + /// Name of the test runner.Supported Frameworks are MSTEST, Playwright, NUNIT. + public RunnerType RunnerType { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFrameworkName.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFrameworkName.cs new file mode 100644 index 000000000000..a78b651df42c --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestFrameworkName.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported Framework. + public readonly partial struct TestFrameworkName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestFrameworkName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PlaywrightValue = "Playwright"; + + /// Playwright. + public static TestFrameworkName Playwright { get; } = new TestFrameworkName(PlaywrightValue); + /// Determines if two values are the same. + public static bool operator ==(TestFrameworkName left, TestFrameworkName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestFrameworkName left, TestFrameworkName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TestFrameworkName(string value) => new TestFrameworkName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestFrameworkName other && Equals(other); + /// + public bool Equals(TestFrameworkName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.Serialization.cs new file mode 100644 index 000000000000..521b29645987 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.Serialization.cs @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class TestRun : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRun)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("testRunId"u8); + writer.WriteStringValue(TestRunId); + } + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreationTime, "O"); + if (options.Format != "W") + { + writer.WritePropertyName("creatorId"u8); + writer.WriteStringValue(CreatorId); + } + if (options.Format != "W") + { + writer.WritePropertyName("creatorName"u8); + writer.WriteStringValue(CreatorName); + } + if (options.Format != "W" && Optional.IsDefined(CloudRunSummary)) + { + writer.WritePropertyName("cloudRunSummary"u8); + writer.WriteObjectValue(CloudRunSummary, options); + } + if (options.Format != "W" && Optional.IsDefined(CloudReportSummary)) + { + writer.WritePropertyName("cloudReportSummary"u8); + writer.WriteObjectValue(CloudReportSummary, options); + } + if (Optional.IsDefined(CiConfig)) + { + writer.WritePropertyName("ciConfig"u8); + writer.WriteObjectValue(CiConfig, options); + } + if (Optional.IsDefined(TestRunConfig)) + { + writer.WritePropertyName("testRunConfig"u8); + writer.WriteObjectValue(TestRunConfig, options); + } + if (options.Format != "W" && Optional.IsDefined(TestResultsUrl)) + { + writer.WritePropertyName("testResultsUrl"u8); + writer.WriteObjectValue(TestResultsUrl, options); + } + if (options.Format != "W") + { + writer.WritePropertyName("cloudRunEnabled"u8); + writer.WriteBooleanValue(CloudRunEnabled); + } + writer.WritePropertyName("cloudReportingEnabled"u8); + writer.WriteBooleanValue(CloudReportingEnabled); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TestRun IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRun)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestRun(document.RootElement, options); + } + + internal static TestRun DeserializeTestRun(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string testRunId = default; + string displayName = default; + DateTimeOffset creationTime = default; + string creatorId = default; + string creatorName = default; + CloudRunSummary cloudRunSummary = default; + CloudReportingSummary cloudReportSummary = default; + CiConfig ciConfig = default; + TestRunConfig testRunConfig = default; + TestResultsUrl testResultsUrl = default; + bool cloudRunEnabled = default; + bool cloudReportingEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("testRunId"u8)) + { + testRunId = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("creatorId"u8)) + { + creatorId = property.Value.GetString(); + continue; + } + if (property.NameEquals("creatorName"u8)) + { + creatorName = property.Value.GetString(); + continue; + } + if (property.NameEquals("cloudRunSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudRunSummary = CloudRunSummary.DeserializeCloudRunSummary(property.Value, options); + continue; + } + if (property.NameEquals("cloudReportSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudReportSummary = CloudReportingSummary.DeserializeCloudReportingSummary(property.Value, options); + continue; + } + if (property.NameEquals("ciConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ciConfig = CiConfig.DeserializeCiConfig(property.Value, options); + continue; + } + if (property.NameEquals("testRunConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testRunConfig = TestRunConfig.DeserializeTestRunConfig(property.Value, options); + continue; + } + if (property.NameEquals("testResultsUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testResultsUrl = TestResultsUrl.DeserializeTestResultsUrl(property.Value, options); + continue; + } + if (property.NameEquals("cloudRunEnabled"u8)) + { + cloudRunEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("cloudReportingEnabled"u8)) + { + cloudReportingEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestRun( + testRunId, + displayName, + creationTime, + creatorId, + creatorName, + cloudRunSummary, + cloudReportSummary, + ciConfig, + testRunConfig, + testResultsUrl, + cloudRunEnabled, + cloudReportingEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestRun)} does not support writing '{options.Format}' format."); + } + } + + TestRun IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestRun(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestRun)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TestRun FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTestRun(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.cs new file mode 100644 index 000000000000..342be7aa26de --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRun.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing detailed information about a test run. + public partial class TestRun + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Display name of the test run All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Creation time of the test run -RFC 3339 literal format. + /// Must be set to true when users want to use Reporting Feature. + /// is null. + public TestRun(string displayName, DateTimeOffset creationTime, bool cloudReportingEnabled) + { + Argument.AssertNotNull(displayName, nameof(displayName)); + + DisplayName = displayName; + CreationTime = creationTime; + CloudReportingEnabled = cloudReportingEnabled; + } + + /// Initializes a new instance of . + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Display name of the test run All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Creation time of the test run -RFC 3339 literal format. + /// Creator's identifier. It's the Id referred in the access/Entra token. + /// Creator's name. + /// Summary of the Cloud executed run. Only available if cloud run is enabled. + /// Summary of reports uploaded on cloud. Only available if cloud reporting is enabled. + /// Continuous integration configuration. + /// Client configuration for the test run. + /// URL for accessing test results. + /// Flag indicating if cloud run is enabled. + /// Must be set to true when users want to use Reporting Feature. + /// Keeps track of any properties unknown to the library. + internal TestRun(string testRunId, string displayName, DateTimeOffset creationTime, string creatorId, string creatorName, CloudRunSummary cloudRunSummary, CloudReportingSummary cloudReportSummary, CiConfig ciConfig, TestRunConfig testRunConfig, TestResultsUrl testResultsUrl, bool cloudRunEnabled, bool cloudReportingEnabled, IDictionary serializedAdditionalRawData) + { + TestRunId = testRunId; + DisplayName = displayName; + CreationTime = creationTime; + CreatorId = creatorId; + CreatorName = creatorName; + CloudRunSummary = cloudRunSummary; + CloudReportSummary = cloudReportSummary; + CiConfig = ciConfig; + TestRunConfig = testRunConfig; + TestResultsUrl = testResultsUrl; + CloudRunEnabled = cloudRunEnabled; + CloudReportingEnabled = cloudReportingEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TestRun() + { + } + + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string TestRunId { get; } + /// Display name of the test run All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string DisplayName { get; set; } + /// Creation time of the test run -RFC 3339 literal format. + public DateTimeOffset CreationTime { get; set; } + /// Creator's identifier. It's the Id referred in the access/Entra token. + public string CreatorId { get; } + /// Creator's name. + public string CreatorName { get; } + /// Summary of the Cloud executed run. Only available if cloud run is enabled. + public CloudRunSummary CloudRunSummary { get; } + /// Summary of reports uploaded on cloud. Only available if cloud reporting is enabled. + public CloudReportingSummary CloudReportSummary { get; } + /// Continuous integration configuration. + public CiConfig CiConfig { get; set; } + /// Client configuration for the test run. + public TestRunConfig TestRunConfig { get; set; } + /// URL for accessing test results. + public TestResultsUrl TestResultsUrl { get; } + /// Flag indicating if cloud run is enabled. + public bool CloudRunEnabled { get; } + /// Must be set to true when users want to use Reporting Feature. + public bool CloudReportingEnabled { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.Serialization.cs new file mode 100644 index 000000000000..025bf233da35 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.Serialization.cs @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class TestRunConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRunConfig)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RetryCount)) + { + writer.WritePropertyName("retryCount"u8); + writer.WriteNumberValue(RetryCount.Value); + } + if (Optional.IsDefined(RepeatEach)) + { + writer.WritePropertyName("repeatEach"u8); + writer.WriteNumberValue(RepeatEach.Value); + } + if (Optional.IsDefined(TestFramework)) + { + writer.WritePropertyName("testFramework"u8); + writer.WriteObjectValue(TestFramework, options); + } + if (Optional.IsDefined(ShardDetails)) + { + writer.WritePropertyName("shardDetails"u8); + writer.WriteObjectValue(ShardDetails, options); + } + writer.WritePropertyName("timeoutInMs"u8); + writer.WriteNumberValue(TimeoutInMs); + if (Optional.IsDefined(TestType)) + { + writer.WritePropertyName("testType"u8); + writer.WriteStringValue(TestType); + } + writer.WritePropertyName("testSdkLanguage"u8); + writer.WriteStringValue(TestSdkLanguage.ToString()); + if (Optional.IsDefined(ServicePackageVersion)) + { + writer.WritePropertyName("servicePackageVersion"u8); + writer.WriteStringValue(ServicePackageVersion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TestRunConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRunConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestRunConfig(document.RootElement, options); + } + + internal static TestRunConfig DeserializeTestRunConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? retryCount = default; + int? repeatEach = default; + TestFramework testFramework = default; + ShardDetails shardDetails = default; + long timeoutInMs = default; + string testType = default; + TestSdkLanguage testSdkLanguage = default; + string servicePackageVersion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("retryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + retryCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("repeatEach"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + repeatEach = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("testFramework"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testFramework = TestFramework.DeserializeTestFramework(property.Value, options); + continue; + } + if (property.NameEquals("shardDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + shardDetails = ShardDetails.DeserializeShardDetails(property.Value, options); + continue; + } + if (property.NameEquals("timeoutInMs"u8)) + { + timeoutInMs = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("testType"u8)) + { + testType = property.Value.GetString(); + continue; + } + if (property.NameEquals("testSdkLanguage"u8)) + { + testSdkLanguage = new TestSdkLanguage(property.Value.GetString()); + continue; + } + if (property.NameEquals("servicePackageVersion"u8)) + { + servicePackageVersion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestRunConfig( + retryCount, + repeatEach, + testFramework, + shardDetails, + timeoutInMs, + testType, + testSdkLanguage, + servicePackageVersion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestRunConfig)} does not support writing '{options.Format}' format."); + } + } + + TestRunConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestRunConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestRunConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TestRunConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTestRunConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.cs new file mode 100644 index 000000000000..cb1672b41a3c --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunConfig.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing client configuration. + public partial class TestRunConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Timeout duration for test execution. + /// Programming language used for the test SDK. Supported languages are 'JavaScript', 'TypeScript', 'Csharp'. + public TestRunConfig(long timeoutInMs, TestSdkLanguage testSdkLanguage) + { + TimeoutInMs = timeoutInMs; + TestSdkLanguage = testSdkLanguage; + } + + /// Initializes a new instance of . + /// Number of retry attempts. + /// Interval between repeated test runs. + /// Details of the test framework used. + /// Details of the shards used in the test. + /// Timeout duration for test execution. + /// Type of test being executed (default: WebTest). + /// Programming language used for the test SDK. Supported languages are 'JavaScript', 'TypeScript', 'Csharp'. + /// Version of the reporter package. + /// Keeps track of any properties unknown to the library. + internal TestRunConfig(int? retryCount, int? repeatEach, TestFramework testFramework, ShardDetails shardDetails, long timeoutInMs, string testType, TestSdkLanguage testSdkLanguage, string servicePackageVersion, IDictionary serializedAdditionalRawData) + { + RetryCount = retryCount; + RepeatEach = repeatEach; + TestFramework = testFramework; + ShardDetails = shardDetails; + TimeoutInMs = timeoutInMs; + TestType = testType; + TestSdkLanguage = testSdkLanguage; + ServicePackageVersion = servicePackageVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TestRunConfig() + { + } + + /// Number of retry attempts. + public int? RetryCount { get; set; } + /// Interval between repeated test runs. + public int? RepeatEach { get; set; } + /// Details of the test framework used. + public TestFramework TestFramework { get; set; } + /// Details of the shards used in the test. + public ShardDetails ShardDetails { get; set; } + /// Timeout duration for test execution. + public long TimeoutInMs { get; set; } + /// Type of test being executed (default: WebTest). + public string TestType { get; set; } + /// Programming language used for the test SDK. Supported languages are 'JavaScript', 'TypeScript', 'Csharp'. + public TestSdkLanguage TestSdkLanguage { get; set; } + /// Version of the reporter package. + public string ServicePackageVersion { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunStatus.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunStatus.cs new file mode 100644 index 000000000000..2d0875843681 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Status of the test run. + public readonly partial struct TestRunStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestRunStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string RunningValue = "Running"; + private const string ClientCompleteValue = "ClientComplete"; + private const string ServerCompleteValue = "ServerComplete"; + + /// The test run is currently running. + public static TestRunStatus Running { get; } = new TestRunStatus(RunningValue); + /// The test run completed on the client side. + public static TestRunStatus ClientComplete { get; } = new TestRunStatus(ClientCompleteValue); + /// The test run completed on the server side. + public static TestRunStatus ServerComplete { get; } = new TestRunStatus(ServerCompleteValue); + /// Determines if two values are the same. + public static bool operator ==(TestRunStatus left, TestRunStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestRunStatus left, TestRunStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TestRunStatus(string value) => new TestRunStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestRunStatus other && Equals(other); + /// + public bool Equals(TestRunStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRuns.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRuns.cs new file mode 100644 index 000000000000..5a6d4c8e3b21 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRuns.cs @@ -0,0 +1,1034 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + // Data plane generated sub-client. + /// The TestRuns sub-client. + public partial class TestRuns + { + private static readonly string[] AuthorizationScopes = new string[] { "https://playwright.microsoft.com/.default" }; + private readonly TokenCredential _tokenCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of TestRuns for mocking. + protected TestRuns() + { + } + + /// Initializes a new instance of TestRuns. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The token credential to copy. + /// + /// Supported Azure Playwright Service API Endpoints (protocol and hostname, for example: + /// https://{region}.reporting.api.playwright.microsoft.com). + /// + /// The API version to use for this operation. + internal TestRuns(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, TokenCredential tokenCredential, Uri endpoint, string apiVersion) + { + ClientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + _tokenCredential = tokenCredential; + _endpoint = endpoint; + _apiVersion = apiVersion; + } + + /// + /// [Protocol Method] Creates or updates a testrun. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateOrUpdateAsync(string accountId, string testRunId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(accountId, testRunId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Creates or updates a testrun. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateOrUpdate(string accountId, string testRunId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.CreateOrUpdate"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateOrUpdateRequest(accountId, testRunId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets a test run. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> GetTestRunAsync(string accountId, string testRunId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await GetTestRunAsync(accountId, testRunId, context).ConfigureAwait(false); + return Response.FromValue(TestRun.FromResponse(response), response); + } + + /// Gets a test run. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response GetTestRun(string accountId, string testRunId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = GetTestRun(accountId, testRunId, context); + return Response.FromValue(TestRun.FromResponse(response), response); + } + + /// + /// [Protocol Method] Gets a test run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task GetTestRunAsync(string accountId, string testRunId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.GetTestRun"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunRequest(accountId, testRunId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Gets a test run. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response GetTestRun(string accountId, string testRunId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.GetTestRun"); + scope.Start(); + try + { + using HttpMessage message = CreateGetTestRunRequest(accountId, testRunId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get TestResults Upload Url. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task> CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await CreateArtifactsUploadBaseUrlAsync(accountId, testRunId, context).ConfigureAwait(false); + return Response.FromValue(TestResultsUrl.FromResponse(response), response); + } + + /// Get TestResults Upload Url. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = CreateArtifactsUploadBaseUrl(accountId, testRunId, context); + return Response.FromValue(TestResultsUrl.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get TestResults Upload Url. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task CreateArtifactsUploadBaseUrlAsync(string accountId, string testRunId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.CreateArtifactsUploadBaseUrl"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateArtifactsUploadBaseUrlRequest(accountId, testRunId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get TestResults Upload Url. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response CreateArtifactsUploadBaseUrl(string accountId, string testRunId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.CreateArtifactsUploadBaseUrl"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateArtifactsUploadBaseUrlRequest(accountId, testRunId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Resource action operation template. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Shard Id for the shard- indexed 1,2,3 etc. + /// Summary of the test run shard. + /// number of workers used by playwright client. + /// Flag indicating if upload is completed for the shard. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual async Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, int shardId, UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(summary, nameof(summary)); + + UpdateShardExecutionStatusRequest updateShardExecutionStatusRequest = new UpdateShardExecutionStatusRequest(shardId, summary, workersCount, uploadCompleted, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await UpdateShardExecutionStatusAsync(accountId, testRunId, updateShardExecutionStatusRequest.ToRequestContent(), context).ConfigureAwait(false); + return response; + } + + /// Resource action operation template. + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Shard Id for the shard- indexed 1,2,3 etc. + /// Summary of the test run shard. + /// number of workers used by playwright client. + /// Flag indicating if upload is completed for the shard. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// + public virtual Response UpdateShardExecutionStatus(string accountId, string testRunId, int shardId, UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(summary, nameof(summary)); + + UpdateShardExecutionStatusRequest updateShardExecutionStatusRequest = new UpdateShardExecutionStatusRequest(shardId, summary, workersCount, uploadCompleted, null); + RequestContext context = FromCancellationToken(cancellationToken); + Response response = UpdateShardExecutionStatus(accountId, testRunId, updateShardExecutionStatusRequest.ToRequestContent(), context); + return response; + } + + /// + /// [Protocol Method] Resource action operation template. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task UpdateShardExecutionStatusAsync(string accountId, string testRunId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.UpdateShardExecutionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateShardExecutionStatusRequest(accountId, testRunId, content, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Resource action operation template. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// Identifier of the test run. All unicode characters except spaces, ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// The content to send as the body of the request. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response UpdateShardExecutionStatus(string accountId, string testRunId, RequestContent content, RequestContext context = null) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + Argument.AssertNotNullOrEmpty(testRunId, nameof(testRunId)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.UpdateShardExecutionStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateShardExecutionStatusRequest(accountId, testRunId, content, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get TestRun summary for an Odata filter.Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator. + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> ComputeAccountRunStatsAsync(string accountId, int? top = null, int? skip = null, int? maxpagesize = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ComputeAccountRunStatsAsync(accountId, top, skip, maxpagesize, filter, context).ConfigureAwait(false); + return Response.FromValue(AccountTestRunStats.FromResponse(response), response); + } + + /// Get TestRun summary for an Odata filter.Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator. + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response ComputeAccountRunStats(string accountId, int? top = null, int? skip = null, int? maxpagesize = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = ComputeAccountRunStats(accountId, top, skip, maxpagesize, filter, context); + return Response.FromValue(AccountTestRunStats.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get TestRun summary for an Odata filter.Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ComputeAccountRunStatsAsync(string accountId, int? top, int? skip, int? maxpagesize, string filter, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.ComputeAccountRunStats"); + scope.Start(); + try + { + using HttpMessage message = CreateComputeAccountRunStatsRequest(accountId, top, skip, maxpagesize, filter, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get TestRun summary for an Odata filter.Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ComputeAccountRunStats(string accountId, int? top, int? skip, int? maxpagesize, string filter, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.ComputeAccountRunStats"); + scope.Start(); + try + { + using HttpMessage message = CreateComputeAccountRunStatsRequest(accountId, top, skip, maxpagesize, filter, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get TestRuns metadata for all runs in an account. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual async Task> ComputeMetadataAsync(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = await ComputeMetadataAsync(accountId, context).ConfigureAwait(false); + return Response.FromValue(TestRunsMetadata.FromResponse(response), response); + } + + /// Get TestRuns metadata for all runs in an account. + /// The account id. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Response ComputeMetadata(string accountId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = FromCancellationToken(cancellationToken); + Response response = ComputeMetadata(accountId, context); + return Response.FromValue(TestRunsMetadata.FromResponse(response), response); + } + + /// + /// [Protocol Method] Get TestRuns metadata for all runs in an account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual async Task ComputeMetadataAsync(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.ComputeMetadata"); + scope.Start(); + try + { + using HttpMessage message = CreateComputeMetadataRequest(accountId, context); + return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// [Protocol Method] Get TestRuns metadata for all runs in an account. + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The response returned from the service. + /// + public virtual Response ComputeMetadata(string accountId, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + using var scope = ClientDiagnostics.CreateScope("TestRuns.ComputeMetadata"); + scope.Start(); + try + { + using HttpMessage message = CreateComputeMetadataRequest(accountId, context); + return _pipeline.ProcessMessage(message, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// List test runs. Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator. + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual AsyncPageable GetTestRunsAsync(string accountId, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTestRunsRequest(accountId, maxCount, skip, pageSizeHint, filter, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTestRunsNextPageRequest(nextLink, accountId, maxCount, skip, pageSizeHint, filter, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => TestRun.DeserializeTestRun(e), ClientDiagnostics, _pipeline, "TestRuns.GetTestRuns", "value", "nextLink", maxpagesize, context); + } + + /// List test runs. Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator. + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// + public virtual Pageable GetTestRuns(string accountId, int? maxCount = null, int? skip = null, int? maxpagesize = null, string filter = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTestRunsRequest(accountId, maxCount, skip, pageSizeHint, filter, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTestRunsNextPageRequest(nextLink, accountId, maxCount, skip, pageSizeHint, filter, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => TestRun.DeserializeTestRun(e), ClientDiagnostics, _pipeline, "TestRuns.GetTestRuns", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] List test runs. Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual AsyncPageable GetTestRunsAsync(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTestRunsRequest(accountId, maxCount, skip, pageSizeHint, filter, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTestRunsNextPageRequest(nextLink, accountId, maxCount, skip, pageSizeHint, filter, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TestRuns.GetTestRuns", "value", "nextLink", maxpagesize, context); + } + + /// + /// [Protocol Method] List test runs. Supported filters are triggeredAt with operator ge, status and branch with in operator, displayName with eq operator + /// + /// + /// + /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios. + /// + /// + /// + /// + /// Please try the simpler convenience overload with strongly typed models first. + /// + /// + /// + /// + /// The account id. + /// The number of result items to return. + /// The number of result items to skip. + /// The maximum number of result items per page. + /// Filter the result list using the given expression. + /// The request context, which can override default behaviors of the client pipeline on a per-call basis. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// Service returned a non-success status code. + /// The from the service containing a list of objects. Details of the body schema for each item in the collection are in the Remarks section below. + /// + public virtual Pageable GetTestRuns(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, RequestContext context) + { + Argument.AssertNotNullOrEmpty(accountId, nameof(accountId)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetTestRunsRequest(accountId, maxCount, skip, pageSizeHint, filter, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetTestRunsNextPageRequest(nextLink, accountId, maxCount, skip, pageSizeHint, filter, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "TestRuns.GetTestRuns", "value", "nextLink", maxpagesize, context); + } + + internal HttpMessage CreateCreateOrUpdateRequest(string accountId, string testRunId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/merge-patch+json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateGetTestRunRequest(string accountId, string testRunId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTestRunsRequest(string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateCreateArtifactsUploadBaseUrlRequest(string accountId, string testRunId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendPath(":createArtifactsUploadBaseUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateUpdateShardExecutionStatusRequest(string accountId, string testRunId, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs/", false); + uri.AppendPath(testRunId, true); + uri.AppendPath(":updateShardExecutionStatus", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + return message; + } + + internal HttpMessage CreateComputeAccountRunStatsRequest(string accountId, int? top, int? skip, int? maxpagesize, string filter, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs:accountRunStats", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + if (filter != null) + { + uri.AppendQuery("filter", filter, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateComputeMetadataRequest(string accountId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/accounts/", false); + uri.AppendPath(accountId, true); + uri.AppendPath("/test-runs:metadata", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + internal HttpMessage CreateGetTestRunsNextPageRequest(string nextLink, string accountId, int? maxCount, int? skip, int? maxpagesize, string filter, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier200); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static RequestContext DefaultRequestContext = new RequestContext(); + internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default) + { + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new RequestContext() { CancellationToken = cancellationToken }; + } + + private static ResponseClassifier _responseClassifier200201; + private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); + private static ResponseClassifier _responseClassifier200; + private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.Serialization.cs new file mode 100644 index 000000000000..a1358de4bfbc --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class TestRunsMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRunsMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("branches"u8); + writer.WriteStartArray(); + foreach (var item in Branches) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + TestRunsMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestRunsMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestRunsMetadata(document.RootElement, options); + } + + internal static TestRunsMetadata DeserializeTestRunsMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList branches = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("branches"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + branches = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestRunsMetadata(branches, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestRunsMetadata)} does not support writing '{options.Format}' format."); + } + } + + TestRunsMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeTestRunsMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestRunsMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static TestRunsMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeTestRunsMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.cs new file mode 100644 index 000000000000..d5dd1f3f7860 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestRunsMetadata.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Metadata for testruns/builds. + public partial class TestRunsMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of CI branches for a testrun, All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// is null. + internal TestRunsMetadata(IEnumerable branches) + { + Argument.AssertNotNull(branches, nameof(branches)); + + Branches = branches.ToList(); + } + + /// Initializes a new instance of . + /// List of CI branches for a testrun, All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Keeps track of any properties unknown to the library. + internal TestRunsMetadata(IReadOnlyList branches, IDictionary serializedAdditionalRawData) + { + Branches = branches; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal TestRunsMetadata() + { + } + + /// List of CI branches for a testrun, All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public IReadOnlyList Branches { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestSdkLanguage.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestSdkLanguage.cs new file mode 100644 index 000000000000..4a5ebf907967 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestSdkLanguage.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Supported Test SDK Language. + public readonly partial struct TestSdkLanguage : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestSdkLanguage(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string JavaScriptValue = "JavaScript"; + private const string TypeScriptValue = "TypeScript"; + private const string CSharpValue = "CSharp"; + + /// JavaScript. + public static TestSdkLanguage JavaScript { get; } = new TestSdkLanguage(JavaScriptValue); + /// TypeScript. + public static TestSdkLanguage TypeScript { get; } = new TestSdkLanguage(TypeScriptValue); + /// Csharp. + public static TestSdkLanguage CSharp { get; } = new TestSdkLanguage(CSharpValue); + /// Determines if two values are the same. + public static bool operator ==(TestSdkLanguage left, TestSdkLanguage right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestSdkLanguage left, TestSdkLanguage right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TestSdkLanguage(string value) => new TestSdkLanguage(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestSdkLanguage other && Equals(other); + /// + public bool Equals(TestSdkLanguage other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestStatus.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestStatus.cs new file mode 100644 index 000000000000..2310949e3755 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/TestStatus.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// status of a test execution. + public readonly partial struct TestStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TestStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PassedValue = "Passed"; + private const string FailedValue = "Failed"; + private const string SkippedValue = "Skipped"; + private const string FlakyValue = "Flaky"; + private const string InterruptedValue = "Interrupted"; + private const string TimedOutValue = "TimedOut"; + + /// The test passed successfully. + public static TestStatus Passed { get; } = new TestStatus(PassedValue); + /// The test failed. + public static TestStatus Failed { get; } = new TestStatus(FailedValue); + /// The test was skipped. + public static TestStatus Skipped { get; } = new TestStatus(SkippedValue); + /// The test was flaky. + public static TestStatus Flaky { get; } = new TestStatus(FlakyValue); + /// The test was interrupted. + public static TestStatus Interrupted { get; } = new TestStatus(InterruptedValue); + /// The test timed out. + public static TestStatus TimedOut { get; } = new TestStatus(TimedOutValue); + /// Determines if two values are the same. + public static bool operator ==(TestStatus left, TestStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TestStatus left, TestStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TestStatus(string value) => new TestStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TestStatus other && Equals(other); + /// + public bool Equals(TestStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.Serialization.cs new file mode 100644 index 000000000000..72240e220a16 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal partial class UpdateShardExecutionStatusRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateShardExecutionStatusRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("shardId"u8); + writer.WriteNumberValue(ShardId); + writer.WritePropertyName("summary"u8); + writer.WriteObjectValue(Summary, options); + writer.WritePropertyName("workersCount"u8); + writer.WriteNumberValue(WorkersCount); + if (Optional.IsDefined(UploadCompleted)) + { + writer.WritePropertyName("uploadCompleted"u8); + writer.WriteBooleanValue(UploadCompleted.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateShardExecutionStatusRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateShardExecutionStatusRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateShardExecutionStatusRequest(document.RootElement, options); + } + + internal static UpdateShardExecutionStatusRequest DeserializeUpdateShardExecutionStatusRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int shardId = default; + UpdateShardExecutionSummary summary = default; + int workersCount = default; + bool? uploadCompleted = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shardId"u8)) + { + shardId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = UpdateShardExecutionSummary.DeserializeUpdateShardExecutionSummary(property.Value, options); + continue; + } + if (property.NameEquals("workersCount"u8)) + { + workersCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("uploadCompleted"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uploadCompleted = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateShardExecutionStatusRequest(shardId, summary, workersCount, uploadCompleted, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateShardExecutionStatusRequest)} does not support writing '{options.Format}' format."); + } + } + + UpdateShardExecutionStatusRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUpdateShardExecutionStatusRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateShardExecutionStatusRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UpdateShardExecutionStatusRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUpdateShardExecutionStatusRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.cs new file mode 100644 index 000000000000..d05cf67608b5 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionStatusRequest.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The UpdateShardExecutionStatusRequest. + internal partial class UpdateShardExecutionStatusRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Shard Id for the shard- indexed 1,2,3 etc. + /// Summary of the test run shard. + /// number of workers used by playwright client. + /// is null. + internal UpdateShardExecutionStatusRequest(int shardId, UpdateShardExecutionSummary summary, int workersCount) + { + Argument.AssertNotNull(summary, nameof(summary)); + + ShardId = shardId; + Summary = summary; + WorkersCount = workersCount; + } + + /// Initializes a new instance of . + /// Shard Id for the shard- indexed 1,2,3 etc. + /// Summary of the test run shard. + /// number of workers used by playwright client. + /// Flag indicating if upload is completed for the shard. + /// Keeps track of any properties unknown to the library. + internal UpdateShardExecutionStatusRequest(int shardId, UpdateShardExecutionSummary summary, int workersCount, bool? uploadCompleted, IDictionary serializedAdditionalRawData) + { + ShardId = shardId; + Summary = summary; + WorkersCount = workersCount; + UploadCompleted = uploadCompleted; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateShardExecutionStatusRequest() + { + } + + /// Shard Id for the shard- indexed 1,2,3 etc. + public int ShardId { get; } + /// Summary of the test run shard. + public UpdateShardExecutionSummary Summary { get; } + /// number of workers used by playwright client. + public int WorkersCount { get; } + /// Flag indicating if upload is completed for the shard. + public bool? UploadCompleted { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.Serialization.cs new file mode 100644 index 000000000000..3379e230f293 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class UpdateShardExecutionSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateShardExecutionSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartTime, "O"); + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndTime, "O"); + if (Optional.IsDefined(UploadMetadata)) + { + writer.WritePropertyName("uploadMetadata"u8); + writer.WriteObjectValue(UploadMetadata, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UpdateShardExecutionSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateShardExecutionSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateShardExecutionSummary(document.RootElement, options); + } + + internal static UpdateShardExecutionSummary DeserializeUpdateShardExecutionSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset startTime = default; + DateTimeOffset endTime = default; + UploadMetadata uploadMetadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startTime"u8)) + { + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("uploadMetadata"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + uploadMetadata = UploadMetadata.DeserializeUploadMetadata(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateShardExecutionSummary(startTime, endTime, uploadMetadata, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UpdateShardExecutionSummary)} does not support writing '{options.Format}' format."); + } + } + + UpdateShardExecutionSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUpdateShardExecutionSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateShardExecutionSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UpdateShardExecutionSummary FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUpdateShardExecutionSummary(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.cs new file mode 100644 index 000000000000..9637ca9147ec --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UpdateShardExecutionSummary.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model to update shard result. + public partial class UpdateShardExecutionSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + public UpdateShardExecutionSummary(DateTimeOffset startTime, DateTimeOffset endTime) + { + StartTime = startTime; + EndTime = endTime; + } + + /// Initializes a new instance of . + /// Start time of the test run in datetime(RFC 3339 literal format). + /// End time of the test run. + /// Metadata related to test run uploads. + /// Keeps track of any properties unknown to the library. + internal UpdateShardExecutionSummary(DateTimeOffset startTime, DateTimeOffset endTime, UploadMetadata uploadMetadata, IDictionary serializedAdditionalRawData) + { + StartTime = startTime; + EndTime = endTime; + UploadMetadata = uploadMetadata; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UpdateShardExecutionSummary() + { + } + + /// Start time of the test run in datetime(RFC 3339 literal format). + public DateTimeOffset StartTime { get; } + /// End time of the test run. + public DateTimeOffset EndTime { get; } + /// Metadata related to test run uploads. + public UploadMetadata UploadMetadata { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.Serialization.cs new file mode 100644 index 000000000000..c49b97e9e62f --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.Serialization.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + internal partial class UploadBatchRequest : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadBatchRequest)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("values"u8); + writer.WriteStartArray(); + foreach (var item in Values) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UploadBatchRequest IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadBatchRequest)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUploadBatchRequest(document.RootElement, options); + } + + internal static UploadBatchRequest DeserializeUploadBatchRequest(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList values = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("values"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TestResultDetails.DeserializeTestResultDetails(item, options)); + } + values = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UploadBatchRequest(values, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UploadBatchRequest)} does not support writing '{options.Format}' format."); + } + } + + UploadBatchRequest IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUploadBatchRequest(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UploadBatchRequest)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UploadBatchRequest FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUploadBatchRequest(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.cs new file mode 100644 index 000000000000..508d7d0a94de --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadBatchRequest.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// The UploadBatchRequest. + internal partial class UploadBatchRequest + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of test results. + /// is null. + internal UploadBatchRequest(IEnumerable values) + { + Argument.AssertNotNull(values, nameof(values)); + + Values = values.ToList(); + } + + /// Initializes a new instance of . + /// List of test results. + /// Keeps track of any properties unknown to the library. + internal UploadBatchRequest(IReadOnlyList values, IDictionary serializedAdditionalRawData) + { + Values = values; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UploadBatchRequest() + { + } + + /// List of test results. + public IReadOnlyList Values { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.Serialization.cs new file mode 100644 index 000000000000..3e455a4bf98d --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class UploadMetadata : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadMetadata)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("testResultsCount"u8); + writer.WriteNumberValue(TestResultsCount); + writer.WritePropertyName("totalAttachmentsCount"u8); + writer.WriteNumberValue(TotalAttachmentsCount); + writer.WritePropertyName("totalAttachmentsSize"u8); + writer.WriteNumberValue(TotalAttachmentsSize); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + UploadMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UploadMetadata)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUploadMetadata(document.RootElement, options); + } + + internal static UploadMetadata DeserializeUploadMetadata(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int testResultsCount = default; + int totalAttachmentsCount = default; + long totalAttachmentsSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("testResultsCount"u8)) + { + testResultsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalAttachmentsCount"u8)) + { + totalAttachmentsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("totalAttachmentsSize"u8)) + { + totalAttachmentsSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UploadMetadata(testResultsCount, totalAttachmentsCount, totalAttachmentsSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(UploadMetadata)} does not support writing '{options.Format}' format."); + } + } + + UploadMetadata IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeUploadMetadata(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UploadMetadata)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static UploadMetadata FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeUploadMetadata(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.cs new file mode 100644 index 000000000000..9bec172f0939 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/UploadMetadata.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Model representing upload metadata. + public partial class UploadMetadata + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Total number of test results uploaded. + /// Total number of attachments uploaded. + /// Total size of attachments uploaded in Bytes. + public UploadMetadata(int testResultsCount, int totalAttachmentsCount, long totalAttachmentsSize) + { + TestResultsCount = testResultsCount; + TotalAttachmentsCount = totalAttachmentsCount; + TotalAttachmentsSize = totalAttachmentsSize; + } + + /// Initializes a new instance of . + /// Total number of test results uploaded. + /// Total number of attachments uploaded. + /// Total size of attachments uploaded in Bytes. + /// Keeps track of any properties unknown to the library. + internal UploadMetadata(int testResultsCount, int totalAttachmentsCount, long totalAttachmentsSize, IDictionary serializedAdditionalRawData) + { + TestResultsCount = testResultsCount; + TotalAttachmentsCount = totalAttachmentsCount; + TotalAttachmentsSize = totalAttachmentsSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal UploadMetadata() + { + } + + /// Total number of test results uploaded. + public int TestResultsCount { get; } + /// Total number of attachments uploaded. + public int TotalAttachmentsCount { get; } + /// Total size of attachments uploaded in Bytes. + public long TotalAttachmentsSize { get; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.Serialization.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.Serialization.cs new file mode 100644 index 000000000000..d81a894590e2 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.Serialization.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + public partial class WebTestConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebTestConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("jobName"u8); + writer.WriteStringValue(JobName); + writer.WritePropertyName("projectName"u8); + writer.WriteStringValue(ProjectName); + writer.WritePropertyName("browserType"u8); + writer.WriteStringValue(BrowserType.ToString()); + writer.WritePropertyName("os"u8); + writer.WriteStringValue(Os.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + WebTestConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebTestConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebTestConfig(document.RootElement, options); + } + + internal static WebTestConfig DeserializeWebTestConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string jobName = default; + string projectName = default; + BrowserType browserType = default; + OsType os = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("jobName"u8)) + { + jobName = property.Value.GetString(); + continue; + } + if (property.NameEquals("projectName"u8)) + { + projectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("browserType"u8)) + { + browserType = new BrowserType(property.Value.GetString()); + continue; + } + if (property.NameEquals("os"u8)) + { + os = new OsType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebTestConfig(jobName, projectName, browserType, os, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(WebTestConfig)} does not support writing '{options.Format}' format."); + } + } + + WebTestConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeWebTestConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebTestConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static WebTestConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content); + return DeserializeWebTestConfig(document.RootElement); + } + + /// Convert into a . + internal virtual RequestContent ToRequestContent() + { + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions); + return content; + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.cs new file mode 100644 index 000000000000..0d75da3ce6b3 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Generated/WebTestConfig.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.Developer.MicrosoftPlaywrightTesting +{ + /// Configuration details for the web test. + public partial class WebTestConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Name of the CI job running the test. All unicode characters except ASCII control characters, special characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Name of the Playwright project.All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Name of the browser. + /// Operating system where the browser is hosted. + /// or is null. + public WebTestConfig(string jobName, string projectName, BrowserType browserType, OsType os) + { + Argument.AssertNotNull(jobName, nameof(jobName)); + Argument.AssertNotNull(projectName, nameof(projectName)); + + JobName = jobName; + ProjectName = projectName; + BrowserType = browserType; + Os = os; + } + + /// Initializes a new instance of . + /// Name of the CI job running the test. All unicode characters except ASCII control characters, special characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Name of the Playwright project.All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + /// Name of the browser. + /// Operating system where the browser is hosted. + /// Keeps track of any properties unknown to the library. + internal WebTestConfig(string jobName, string projectName, BrowserType browserType, OsType os, IDictionary serializedAdditionalRawData) + { + JobName = jobName; + ProjectName = projectName; + BrowserType = browserType; + Os = os; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebTestConfig() + { + } + + /// Name of the CI job running the test. All unicode characters except ASCII control characters, special characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string JobName { get; set; } + /// Name of the Playwright project.All unicode characters except ASCII control characters, special Git characters (^, ~, :, ?, *, [, ]), double dots (..), multiple consecutive slashes (//), or start/end with a slash (/) or start with period (.). + public string ProjectName { get; set; } + /// Name of the browser. + public BrowserType BrowserType { get; set; } + /// Operating system where the browser is hosted. + public OsType Os { get; set; } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..145709b2db91 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.Developer.MicrosoftPlaywrightTesting.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("Microsoft.Template")] diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj new file mode 100644 index 000000000000..f3becb133be8 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Azure.Developer.MicrosoftPlaywrightTesting.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestResults.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestResults.cs new file mode 100644 index 000000000000..b68219776224 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestResults.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.Samples +{ + public partial class Samples_TestResults + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResults_UploadBatch_TestResultsUploadBatch() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + values = new object[] + { +new +{ +testExecutionId = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +testId = "216f18b4-7fd4-3292-2fbe-b1630c317160", +testCombinationId = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +shardId = 1, +suiteId = "3dd73f57a76177b79e47c6e948989a31837b5fde", +testTitle = "HasTitle", +suiteTitle = "PlaywrightTests.ExampleTest", +fileName = "PlaywrightTests.dll", +lineNumber = 0, +retryCount = 0, +status = "Passed", +webTestConfig = new +{ +jobName = "", +projectName = "", +os = "Windows", +}, +durationInMs = 15531L, +startTime = "2025-01-09T12:20:20Z", +attachmentsMetadata = new object[] +{ +"Image", +"Video" +}, +ciConfig = new +{ +ciProviderName = "Default", +}, +artifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +}, +new +{ +testExecutionId = "f062a075-652d-4ef2-badc-24a1dbc307fb", +testId = "61a30792-6ba0-6b29-4561-0637526eba2d", +testCombinationId = "f062a075-652d-4ef2-badc-24a1dbc307fb", +shardId = 1, +suiteId = "3dd73f57a76177b79e47c6e948989a31837b5fde", +testTitle = "GetStartedLink", +suiteTitle = "PlaywrightTests.ExampleTest", +fileName = "PlaywrightTests.dll", +lineNumber = 0, +retryCount = 0, +status = "Passed", +webTestConfig = new +{ +jobName = "", +projectName = "", +os = "Windows", +}, +ciConfig = new +{ +ciProviderName = "Default", +}, +durationInMs = 15531L, +startTime = "2025-01-09T12:20:20Z", +attachmentsMetadata = new object[] +{ +"Image", +"Video" +}, +artifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +} + }, + }); + Response response = client.UploadBatch("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "4c57e3a2-8a9c-4659-91f3-30ff4115f212", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResults_UploadBatch_TestResultsUploadBatch_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + values = new object[] + { +new +{ +testExecutionId = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +testId = "216f18b4-7fd4-3292-2fbe-b1630c317160", +testCombinationId = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +shardId = 1, +suiteId = "3dd73f57a76177b79e47c6e948989a31837b5fde", +testTitle = "HasTitle", +suiteTitle = "PlaywrightTests.ExampleTest", +fileName = "PlaywrightTests.dll", +lineNumber = 0, +retryCount = 0, +status = "Passed", +webTestConfig = new +{ +jobName = "", +projectName = "", +os = "Windows", +}, +durationInMs = 15531L, +startTime = "2025-01-09T12:20:20Z", +attachmentsMetadata = new object[] +{ +"Image", +"Video" +}, +ciConfig = new +{ +ciProviderName = "Default", +}, +artifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +}, +new +{ +testExecutionId = "f062a075-652d-4ef2-badc-24a1dbc307fb", +testId = "61a30792-6ba0-6b29-4561-0637526eba2d", +testCombinationId = "f062a075-652d-4ef2-badc-24a1dbc307fb", +shardId = 1, +suiteId = "3dd73f57a76177b79e47c6e948989a31837b5fde", +testTitle = "GetStartedLink", +suiteTitle = "PlaywrightTests.ExampleTest", +fileName = "PlaywrightTests.dll", +lineNumber = 0, +retryCount = 0, +status = "Passed", +webTestConfig = new +{ +jobName = "", +projectName = "", +os = "Windows", +}, +ciConfig = new +{ +ciProviderName = "Default", +}, +durationInMs = 15531L, +startTime = "2025-01-09T12:20:20Z", +attachmentsMetadata = new object[] +{ +"Image", +"Video" +}, +artifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +} + }, + }); + Response response = await client.UploadBatchAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "4c57e3a2-8a9c-4659-91f3-30ff4115f212", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResults_UploadBatch_TestResultsUploadBatch_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = client.UploadBatch("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "4c57e3a2-8a9c-4659-91f3-30ff4115f212", new TestResultDetails[] + { +new TestResultDetails( + "4c57e3a2-8a9c-4659-91f3-30ff4115f187", + "216f18b4-7fd4-3292-2fbe-b1630c317160", + "4c57e3a2-8a9c-4659-91f3-30ff4115f187", + 1, + "3dd73f57a76177b79e47c6e948989a31837b5fde", + "HasTitle", + "PlaywrightTests.ExampleTest", + "PlaywrightTests.dll", + 0, + 0, + TestStatus.Passed, + 15531L, + DateTimeOffset.Parse("2025-01-09T12:20:20Z")) +{ +WebTestConfig = new WebTestConfig("", "", default, OsType.Windows), +AttachmentsMetadata = {AttachmentKind.Image, AttachmentKind.Video}, +ArtifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +}, +new TestResultDetails( + "f062a075-652d-4ef2-badc-24a1dbc307fb", + "61a30792-6ba0-6b29-4561-0637526eba2d", + "f062a075-652d-4ef2-badc-24a1dbc307fb", + 1, + "3dd73f57a76177b79e47c6e948989a31837b5fde", + "GetStartedLink", + "PlaywrightTests.ExampleTest", + "PlaywrightTests.dll", + 0, + 0, + TestStatus.Passed, + 15531L, + DateTimeOffset.Parse("2025-01-09T12:20:20Z")) +{ +WebTestConfig = new WebTestConfig("", "", default, OsType.Windows), +AttachmentsMetadata = {AttachmentKind.Image, AttachmentKind.Video}, +ArtifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResults_UploadBatch_TestResultsUploadBatch_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = await client.UploadBatchAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "4c57e3a2-8a9c-4659-91f3-30ff4115f212", new TestResultDetails[] + { +new TestResultDetails( + "4c57e3a2-8a9c-4659-91f3-30ff4115f187", + "216f18b4-7fd4-3292-2fbe-b1630c317160", + "4c57e3a2-8a9c-4659-91f3-30ff4115f187", + 1, + "3dd73f57a76177b79e47c6e948989a31837b5fde", + "HasTitle", + "PlaywrightTests.ExampleTest", + "PlaywrightTests.dll", + 0, + 0, + TestStatus.Passed, + 15531L, + DateTimeOffset.Parse("2025-01-09T12:20:20Z")) +{ +WebTestConfig = new WebTestConfig("", "", default, OsType.Windows), +AttachmentsMetadata = {AttachmentKind.Image, AttachmentKind.Video}, +ArtifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +}, +new TestResultDetails( + "f062a075-652d-4ef2-badc-24a1dbc307fb", + "61a30792-6ba0-6b29-4561-0637526eba2d", + "f062a075-652d-4ef2-badc-24a1dbc307fb", + 1, + "3dd73f57a76177b79e47c6e948989a31837b5fde", + "GetStartedLink", + "PlaywrightTests.ExampleTest", + "PlaywrightTests.dll", + 0, + 0, + TestStatus.Passed, + 15531L, + DateTimeOffset.Parse("2025-01-09T12:20:20Z")) +{ +WebTestConfig = new WebTestConfig("", "", default, OsType.Windows), +AttachmentsMetadata = {AttachmentKind.Image, AttachmentKind.Video}, +ArtifactsPath = "4c57e3a2-8a9c-4659-91f3-30ff4115f187", +} + }); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResults_ComputeResultsStats_TestResultsGetTestResultsSummary() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeResultsStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("passed").ToString()); + Console.WriteLine(result.GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("flaky").ToString()); + Console.WriteLine(result.GetProperty("skipped").ToString()); + Console.WriteLine(result.GetProperty("all").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResults_ComputeResultsStats_TestResultsGetTestResultsSummary_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeResultsStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, null, null, null, null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("passed").ToString()); + Console.WriteLine(result.GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("flaky").ToString()); + Console.WriteLine(result.GetProperty("skipped").ToString()); + Console.WriteLine(result.GetProperty("all").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResults_ComputeResultsStats_TestResultsGetTestResultsSummary_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeResultsStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResults_ComputeResultsStats_TestResultsGetTestResultsSummary_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeResultsStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResultDetails_GetTestResultDetails_TestResultsListTestResults() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + foreach (BinaryData item in client.GetTestResultDetails("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testExecutionId").ToString()); + Console.WriteLine(result.GetProperty("testId").ToString()); + Console.WriteLine(result.GetProperty("testCombinationId").ToString()); + Console.WriteLine(result.GetProperty("runId").ToString()); + Console.WriteLine(result.GetProperty("shardId").ToString()); + Console.WriteLine(result.GetProperty("accountId").ToString()); + Console.WriteLine(result.GetProperty("suiteId").ToString()); + Console.WriteLine(result.GetProperty("testTitle").ToString()); + Console.WriteLine(result.GetProperty("suiteTitle").ToString()); + Console.WriteLine(result.GetProperty("fileName").ToString()); + Console.WriteLine(result.GetProperty("lineNumber").ToString()); + Console.WriteLine(result.GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("durationInMs").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResultDetails_GetTestResultDetails_TestResultsListTestResults_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + await foreach (BinaryData item in client.GetTestResultDetailsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testExecutionId").ToString()); + Console.WriteLine(result.GetProperty("testId").ToString()); + Console.WriteLine(result.GetProperty("testCombinationId").ToString()); + Console.WriteLine(result.GetProperty("runId").ToString()); + Console.WriteLine(result.GetProperty("shardId").ToString()); + Console.WriteLine(result.GetProperty("accountId").ToString()); + Console.WriteLine(result.GetProperty("suiteId").ToString()); + Console.WriteLine(result.GetProperty("testTitle").ToString()); + Console.WriteLine(result.GetProperty("suiteTitle").ToString()); + Console.WriteLine(result.GetProperty("fileName").ToString()); + Console.WriteLine(result.GetProperty("lineNumber").ToString()); + Console.WriteLine(result.GetProperty("retryCount").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("durationInMs").ToString()); + Console.WriteLine(result.GetProperty("startTime").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestResultDetails_GetTestResultDetails_TestResultsListTestResults_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + foreach (TestResultDetails item in client.GetTestResultDetails("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestResultDetails_GetTestResultDetails_TestResultsListTestResults_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestResults client = new ReportingClient(endpoint, credential).GetTestResultsClient(apiVersion: "2025-02-24"); + + await foreach (TestResultDetails item in client.GetTestResultDetailsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) + { + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestRuns.cs b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestRuns.cs new file mode 100644 index 000000000000..349bb2a6d383 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tests/Generated/Samples/Samples_TestRuns.cs @@ -0,0 +1,505 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.Developer.MicrosoftPlaywrightTesting.Samples +{ + public partial class Samples_TestRuns + { + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRun_CreateOrUpdate_TestRunsCreateOrUpdateTestRun() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Sample Test Run", + creationTime = "2024-09-28T12:32:33Z", + ciConfig = new + { + branch = "main", + author = "John Doe", + revisionUrl = "https://github.com/azure-rest-api-specs/1234", + }, + testRunConfig = new + { + retryCount = 3, + repeatEach = 5000, + testFramework = new + { + name = "Playwright", + version = "3.1.0", + runnerType = "Nunit", + }, + shardDetails = new + { + total = 5, + }, + timeoutInMs = 60000L, + testType = "WebTest", + testSdkLanguage = "JavaScript", + servicePackageVersion = "1.0.0-beta.4", + }, + cloudReportingEnabled = false, + }); + Response response = client.CreateOrUpdate("4eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRun_CreateOrUpdate_TestRunsCreateOrUpdateTestRun_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + displayName = "Sample Test Run", + creationTime = "2024-09-28T12:32:33Z", + ciConfig = new + { + branch = "main", + author = "John Doe", + revisionUrl = "https://github.com/azure-rest-api-specs/1234", + }, + testRunConfig = new + { + retryCount = 3, + repeatEach = 5000, + testFramework = new + { + name = "Playwright", + version = "3.1.0", + runnerType = "Nunit", + }, + shardDetails = new + { + total = 5, + }, + timeoutInMs = 60000L, + testType = "WebTest", + testSdkLanguage = "JavaScript", + servicePackageVersion = "1.0.0-beta.4", + }, + cloudReportingEnabled = false, + }); + Response response = await client.CreateOrUpdateAsync("4eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRun_GetTestRun_TestRunsGetTestRun() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.GetTestRun("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRun_GetTestRun_TestRunsGetTestRun_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.GetTestRunAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRun_GetTestRun_TestRunsGetTestRun_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.GetTestRun("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRun_GetTestRun_TestRunsGetTestRun_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.GetTestRunAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_CreateArtifactsUploadBaseUrl_TestRunsCreateArtifactsUploadBaseUrl() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.CreateArtifactsUploadBaseUrl("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("accessLevel").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_CreateArtifactsUploadBaseUrl_TestRunsCreateArtifactsUploadBaseUrl_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.CreateArtifactsUploadBaseUrlAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("url").ToString()); + Console.WriteLine(result.GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("expiresAt").ToString()); + Console.WriteLine(result.GetProperty("accessLevel").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_CreateArtifactsUploadBaseUrl_TestRunsCreateArtifactsUploadBaseUrl_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.CreateArtifactsUploadBaseUrl("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_CreateArtifactsUploadBaseUrl_TestRunsCreateArtifactsUploadBaseUrl_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.CreateArtifactsUploadBaseUrlAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_UpdateShardExecutionStatus_TestRunsUpdateShardExecutionStatus() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + shardId = 1, + workersCount = 5, + uploadCompleted = true, + summary = new + { + startTime = "8819-10-30T18:52:21Z", + endTime = "6230-12-03T14:22:58Z", + uploadMetadata = new + { + testResultsCount = 100, + totalAttachmentsCount = 100, + totalAttachmentsSize = 48200L, + }, + }, + }); + Response response = client.UpdateShardExecutionStatus("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_UpdateShardExecutionStatus_TestRunsUpdateShardExecutionStatus_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + using RequestContent content = RequestContent.Create(new + { + shardId = 1, + workersCount = 5, + uploadCompleted = true, + summary = new + { + startTime = "8819-10-30T18:52:21Z", + endTime = "6230-12-03T14:22:58Z", + uploadMetadata = new + { + testResultsCount = 100, + totalAttachmentsCount = 100, + totalAttachmentsSize = 48200L, + }, + }, + }); + Response response = await client.UpdateShardExecutionStatusAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", content); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_UpdateShardExecutionStatus_TestRunsUpdateShardExecutionStatus_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + UpdateShardExecutionSummary summary = new UpdateShardExecutionSummary(DateTimeOffset.Parse("8819-10-30T18:52:21Z"), DateTimeOffset.Parse("6230-12-03T14:22:58Z")) + { + UploadMetadata = new UploadMetadata(100, 100, 48200L), + }; + Response response = client.UpdateShardExecutionStatus("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", 1, summary, 5); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_UpdateShardExecutionStatus_TestRunsUpdateShardExecutionStatus_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + UpdateShardExecutionSummary summary = new UpdateShardExecutionSummary(DateTimeOffset.Parse("8819-10-30T18:52:21Z"), DateTimeOffset.Parse("6230-12-03T14:22:58Z")) + { + UploadMetadata = new UploadMetadata(100, 100, 48200L), + }; + Response response = await client.UpdateShardExecutionStatusAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", "123e4567-e89b-12d3-a456-426614174000", 1, summary, 5); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_ComputeAccountRunStats_TestRunsComputeAccountRunStats() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeAccountRunStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", 10, 0, 50, "status eq 'FAILED'", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("passed").ToString()); + Console.WriteLine(result.GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("flaky").ToString()); + Console.WriteLine(result.GetProperty("all").ToString()); + Console.WriteLine(result.GetProperty("cloudExecutionRuns").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_ComputeAccountRunStats_TestRunsComputeAccountRunStats_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeAccountRunStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", 10, 0, 50, "status eq 'FAILED'", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("passed").ToString()); + Console.WriteLine(result.GetProperty("failed").ToString()); + Console.WriteLine(result.GetProperty("flaky").ToString()); + Console.WriteLine(result.GetProperty("all").ToString()); + Console.WriteLine(result.GetProperty("cloudExecutionRuns").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_ComputeAccountRunStats_TestRunsComputeAccountRunStats_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeAccountRunStats("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_ComputeAccountRunStats_TestRunsComputeAccountRunStats_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeAccountRunStatsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_ComputeMetadata_TestRunsComputeTestRunMetadata() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeMetadata("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("branches")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_ComputeMetadata_TestRunsComputeTestRunMetadata_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeMetadataAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("branches")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRuns_ComputeMetadata_TestRunsComputeTestRunMetadata_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = client.ComputeMetadata("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRuns_ComputeMetadata_TestRunsComputeTestRunMetadata_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + Response response = await client.ComputeMetadataAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRun_GetTestRuns_TestRunsListTestRuns() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + foreach (BinaryData item in client.GetTestRuns("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRun_GetTestRuns_TestRunsListTestRuns_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + await foreach (BinaryData item in client.GetTestRunsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a", null, 0, null, "status eq 'Passed'", null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("testRunId").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("creationTime").ToString()); + Console.WriteLine(result.GetProperty("creatorId").ToString()); + Console.WriteLine(result.GetProperty("creatorName").ToString()); + Console.WriteLine(result.GetProperty("cloudRunEnabled").ToString()); + Console.WriteLine(result.GetProperty("cloudReportingEnabled").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_TestRun_GetTestRuns_TestRunsListTestRuns_Convenience() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + foreach (TestRun item in client.GetTestRuns("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) + { + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_TestRun_GetTestRuns_TestRunsListTestRuns_Convenience_Async() + { + Uri endpoint = new Uri(""); + TokenCredential credential = new DefaultAzureCredential(); + TestRuns client = new ReportingClient(endpoint, credential).GetTestRunsClient(apiVersion: "2025-02-24"); + + await foreach (TestRun item in client.GetTestRunsAsync("eastasia_a56bbc94-fbb7-4c20-9b17-981067e4580a")) + { + } + } + } +} diff --git a/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml new file mode 100644 index 000000000000..2a4edbf86628 --- /dev/null +++ b/sdk/playwrighttesting/Azure.Developer.MicrosoftPlaywrightTesting/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/playwrighttesting/PlaywrightTesting.Reporting +commit: fb96f25c797ef5a3d81cc80badfefb8230c6fca9 +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/playwrighttesting/PlaywrightTesting.Shared