From 28db213372350498ee7bc746a86ca148c20edd69 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 8 May 2025 02:47:35 +0000 Subject: [PATCH] CodeGen from PR 33962 in Azure/azure-rest-api-specs Merge 8398cf551bb1b81d24a695977c7725334041ddcf into 121c5e84647a9cdb1767d5146affdfe2af91d776 --- .../Azure.AI.Projects.1DP.sln | 56 + sdk/ai/Azure.AI.Projects.1DP/CHANGELOG.md | 11 + .../Directory.Build.props | 6 + sdk/ai/Azure.AI.Projects.1DP/README.md | 107 + .../src/Azure.AI.Projects.1DP.csproj | 20 + .../src/Generated/AIProjectClient.cs | 166 ++ .../AIProjects1DPClientBuilderExtensions.cs | 46 + .../Generated/AIProjects1DPModelFactory.cs | 661 ++++++ .../src/Generated/Connections.cs | 188 ++ .../src/Generated/Datasets.cs | 397 ++++ .../src/Generated/Docs/Connections.xml | 353 ++++ .../src/Generated/Docs/Datasets.xml | 821 ++++++++ .../src/Generated/Docs/Deployments.xml | 201 ++ .../src/Generated/Docs/EvaluationResults.xml | 801 ++++++++ .../src/Generated/Docs/Evaluations.xml | 1569 +++++++++++++++ .../src/Generated/Docs/Indexes.xml | 547 +++++ .../src/Generated/Docs/RedTeams.xml | 1611 +++++++++++++++ .../src/Generated/EvaluationResults.cs | 397 ++++ .../src/Generated/Indexes.cs | 357 ++++ .../UnknownBaseCredentials.Serialization.cs | 126 ++ .../src/Generated/UnknownBaseCredentials.cs | 28 + .../UnknownConnection.Serialization.cs | 175 ++ .../src/Generated/UnknownConnection.cs | 38 + .../UnknownDatasetVersion.Serialization.cs | 197 ++ .../src/Generated/UnknownDatasetVersion.cs | 36 + .../UnknownDeployment.Serialization.cs | 132 ++ .../src/Generated/UnknownDeployment.cs | 29 + .../Generated/UnknownIndex.Serialization.cs | 179 ++ .../src/Generated/UnknownIndex.cs | 34 + .../UnknownInputData.Serialization.cs | 126 ++ .../src/Generated/UnknownInputData.cs | 28 + .../UnknownTargetModelConfig.Serialization.cs | 126 ++ .../src/Generated/UnknownTargetModelConfig.cs | 28 + .../src/Properties/AssemblyInfo.cs | 11 + .../tests/Azure.AI.Projects.1DP.Tests.csproj | 20 + .../Generated/Samples/Samples_Connections.cs | 402 ++++ .../Generated/Samples/Samples_Datasets.cs | 913 +++++++++ .../Generated/Samples/Samples_Deployments.cs | 238 +++ .../Samples/Samples_EvaluationResults.cs | 893 +++++++++ .../Generated/Samples/Samples_Evaluations.cs | 1674 ++++++++++++++++ .../Generated/Samples/Samples_Indexes.cs | 615 ++++++ .../Generated/Samples/Samples_RedTeams.cs | 1764 +++++++++++++++++ .../Azure.AI.Projects.1DP/tsp-location.yaml | 4 + sdk/ai/ci.yml | 35 + 44 files changed, 16166 insertions(+) create mode 100644 sdk/ai/Azure.AI.Projects.1DP/Azure.AI.Projects.1DP.sln create mode 100644 sdk/ai/Azure.AI.Projects.1DP/CHANGELOG.md create mode 100644 sdk/ai/Azure.AI.Projects.1DP/Directory.Build.props create mode 100644 sdk/ai/Azure.AI.Projects.1DP/README.md create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Azure.AI.Projects.1DP.csproj create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjectClient.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPClientBuilderExtensions.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPModelFactory.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Connections.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Datasets.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Connections.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Datasets.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Deployments.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/EvaluationResults.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Evaluations.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Indexes.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/RedTeams.xml create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/EvaluationResults.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/Indexes.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.Serialization.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/src/Properties/AssemblyInfo.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Azure.AI.Projects.1DP.Tests.csproj create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Connections.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Datasets.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Deployments.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_EvaluationResults.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Evaluations.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Indexes.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_RedTeams.cs create mode 100644 sdk/ai/Azure.AI.Projects.1DP/tsp-location.yaml create mode 100644 sdk/ai/ci.yml diff --git a/sdk/ai/Azure.AI.Projects.1DP/Azure.AI.Projects.1DP.sln b/sdk/ai/Azure.AI.Projects.1DP/Azure.AI.Projects.1DP.sln new file mode 100644 index 000000000000..a9b527f621ec --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/Azure.AI.Projects.1DP.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.AI.Projects.1DP", "src\Azure.AI.Projects.1DP.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Projects.1DP.Tests", "tests\Azure.AI.Projects.1DP.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/ai/Azure.AI.Projects.1DP/CHANGELOG.md b/sdk/ai/Azure.AI.Projects.1DP/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/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/ai/Azure.AI.Projects.1DP/Directory.Build.props b/sdk/ai/Azure.AI.Projects.1DP/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/ai/Azure.AI.Projects.1DP/README.md b/sdk/ai/Azure.AI.Projects.1DP/README.md new file mode 100644 index 000000000000..c3654eada7fe --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/README.md @@ -0,0 +1,107 @@ +# Azure.AI.Projects.1DP client library for .NET + +Azure.AI.Projects.1DP 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/ai/Azure.AI.Projects.1DP/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.AI.Projects.1DP --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/ai/Azure.AI.Projects.1DP/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/ai/Azure.AI.Projects.1DP/README.png) \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Azure.AI.Projects.1DP.csproj b/sdk/ai/Azure.AI.Projects.1DP/src/Azure.AI.Projects.1DP.csproj new file mode 100644 index 000000000000..df108e7e9fd2 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Azure.AI.Projects.1DP.csproj @@ -0,0 +1,20 @@ + + + This is the Azure.AI.Projects.1DP client library for developing .NET applications with rich experience. + Azure SDK Code Generation Azure.AI.Projects.1DP for Azure Data Plane + 1.0.0-beta.1 + Azure.AI.Projects.1DP + $(RequiredTargetFrameworks) + true + + + + + + + + + + + + diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjectClient.cs new file mode 100644 index 000000000000..4586607a5eef --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjectClient.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Projects.1DP +{ +// Data plane generated client. +/// The AIProject service client. +public partial class AIProjectClient +{ + private const string AuthorizationHeader = "Authorization"; + private readonly AzureKeyCredential _keyCredential; + private const string AuthorizationApiKeyPrefix = "Bearer"; + private static readonly string[] AuthorizationScopes = new string[] { "https://cognitiveservices.azure.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 AIProjectClient for mocking. + protected AIProjectClient() + { + } + + /// Initializes a new instance of AIProjectClient. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AIProjectClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new Projects.1DP.AIProjectClientOptions()) + { + } + + /// Initializes a new instance of AIProjectClient. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AIProjectClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new Projects.1DP.AIProjectClientOptions()) + { + } + + /// Initializes a new instance of AIProjectClient. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AIProjectClient(Uri endpoint, AzureKeyCredential credential, Projects.1DP.AIProjectClientOptions options) + { + AI.Projects.1DP.Argument.AssertNotNull(endpoint, nameof(endpoint)); + AI.Projects.1DP.Argument.AssertNotNull(credential, nameof(credential)); + options ??= new Projects.1DP.AIProjectClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader, AuthorizationApiKeyPrefix) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + /// Initializes a new instance of AIProjectClient. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + /// A credential used to authenticate to an Azure Service. + /// The options for configuring the client. + /// or is null. + public AIProjectClient(Uri endpoint, TokenCredential credential, Projects.1DP.AIProjectClientOptions options) + { + AI.Projects.1DP.Argument.AssertNotNull(endpoint, nameof(endpoint)); + AI.Projects.1DP.Argument.AssertNotNull(credential, nameof(credential)); + options ??= new Projects.1DP.AIProjectClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _tokenCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier()); + _endpoint = endpoint; + } + + private Projects.1DP.ServicePatterns _cachedServicePatterns; + + /// Initializes a new instance of ServicePatterns. + public virtual Projects.1DP.ServicePatterns GetServicePatternsClient() + { + return Volatile.Read(ref _cachedServicePatterns) ?? Interlocked.CompareExchange(ref _cachedServicePatterns, new Projects.1DP.ServicePatterns(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint), null) ?? _cachedServicePatterns; + } + + /// Initializes a new instance of Connections. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.Connections GetConnectionsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.Connections(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of Evaluations. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.Evaluations GetEvaluationsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.Evaluations(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of Datasets. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.Datasets GetDatasetsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.Datasets(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of Indexes. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.Indexes GetIndexesClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.Indexes(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of Deployments. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.Deployments GetDeploymentsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.Deployments(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of RedTeams. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.RedTeams GetRedTeamsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.RedTeams(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } + + /// Initializes a new instance of EvaluationResults. + /// The API version to use for this operation. + /// is null. + public virtual Projects.1DP.EvaluationResults GetEvaluationResultsClient(string apiVersion = "2025-05-15-preview") + { + AI.Projects.1DP.Argument.AssertNotNull(apiVersion, nameof(apiVersion)); + + return new Projects.1DP.EvaluationResults(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion); + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPClientBuilderExtensions.cs new file mode 100644 index 000000000000..84f83dd22f2a --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPClientBuilderExtensions.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; +using Azure.AI.Projects.1DP; +using Azure.Core.Extensions; + +namespace Microsoft.Extensions.Azure +{ + /// Extension methods to add to client builder. + public static partial class AIProjects1DPClientBuilderExtensions + { + /// Registers a instance. + /// The builder to register with. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + /// A credential used to authenticate to an Azure Service. + public static global::Azure.Core.Extensions.IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential) + where TBuilder : global::Azure.Core.Extensions.IAzureClientFactoryBuilder + { + return builder.RegisterClientFactory < global::Azure.AI.Projects.1DP.AIProjectClient,global::Azure.AI.Projects.1DP.AIProjectClientOptions > ((options) => new global::Azure.AI.Projects.1DP.AIProjectClient(endpoint, credential, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// Project endpoint in the form of: https://<aiservices-id>.services.ai.azure.com/api/projects/<project-name>. + public static global::Azure.Core.Extensions.IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint) + where TBuilder : global::Azure.Core.Extensions.IAzureClientFactoryBuilderWithCredential + { + return builder.RegisterClientFactory < global::Azure.AI.Projects.1DP.AIProjectClient,global::Azure.AI.Projects.1DP.AIProjectClientOptions > ((options, cred) => new global::Azure.AI.Projects.1DP.AIProjectClient(endpoint, cred, options)); + } + + /// Registers a instance. + /// The builder to register with. + /// The configuration values. + public static global::Azure.Core.Extensions.IAzureClientBuilder AddAIProjectClient(this TBuilder builder, TConfiguration configuration) + where TBuilder : global::Azure.Core.Extensions.IAzureClientFactoryBuilderWithConfiguration + { + return builder.RegisterClientFactory < global::Azure.AI.Projects.1DP.AIProjectClient,global::Azure.AI.Projects.1DP.AIProjectClientOptions > configuration; + } + } +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPModelFactory.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPModelFactory.cs new file mode 100644 index 000000000000..0a09a17a0061 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/AIProjects1DPModelFactory.cs @@ -0,0 +1,661 @@ +// 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.AI.Projects.1DP +{ + +/// Initializes a new instance of . +/// API Key. +/// A new instance for mocking. +public static Projects.1DP.ApiKeyCredentials ApiKeyCredentials(string apiKey = null) +{ + return new Projects.1DP.ApiKeyCredentials(AI.Projects.1DP.CredentialType.ApiKey, serializedAdditionalRawData: null, apiKey); +} + +/// Initializes a new instance of . +/// SAS token. +/// A new instance for mocking. +public static Projects.1DP.SASCredentials SASCredentials(string sasToken = null) +{ + return new Projects.1DP.SASCredentials(AI.Projects.1DP.CredentialType.SAS, serializedAdditionalRawData: null, sasToken); +} + +/// Initializes a new instance of . +/// Identifier of the evaluation. +/// +/// Data for evaluation. +/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +/// The available derived classes include . +/// +/// Evaluation target specifying the model config and parameters. +/// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. +/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. +/// Metadata containing createdBy and modifiedBy information. +/// Status of the evaluation. It is set by service and is read-only. +/// Evaluation's tags. Unlike properties, tags are fully mutable. +/// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. +/// Evaluators to be used for the evaluation. +/// Read-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/versions/{dataset-version}' }. +/// A new instance for mocking. +public static Projects.1DP.Evaluation Evaluation(string id = null, Projects.1DP.InputData data = (Projects.1DP.InputData)null,Projects.1DP.EvaluationTarget target = (Projects.1DP.EvaluationTarget)null,string displayName = null,string description = null, global::Azure.AI.Projects.1DP.SystemData systemData = (Projects.1DP.SystemData)null,string status = null, global::System.Collections.Generic.IDictionary tags = (IDictionary)null, global::System.Collections.Generic.IDictionary properties = (IDictionary)null, global::System.Collections.Generic.IDictionary evaluators = (System.Collections.Generic.IDictionary < string, AI.Projects.1DP.EvaluatorConfiguration>)null,IReadOnlyDictionary outputs = null) +{ +tags ??= new Dictionary(); +properties ??= new Dictionary(); +evaluators ??= new System.Collections.Generic.Dictionary(); +outputs ??= new Dictionary(); + +return new Projects.1DP.Evaluation( + id, + data, + target, + displayName, + description, + systemData, + status, + tags, + properties, + evaluators, + outputs, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The timestamp the resource was created at. +/// The identity that created the resource. +/// The identity type that created the resource. +/// The timestamp of resource last modification (UTC). +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.SystemData SystemData(DateTimeOffset? createdAt = (DateTimeOffset?)null, string createdBy = (string)null, string createdByType = (string)null, DateTimeOffset? lastModifiedAt = (DateTimeOffset?)null) +{ + return new Azure.AI.Projects.1DP.SystemData(createdAt, createdBy, createdByType, lastModifiedAt, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Identifier of the evaluation. +/// +/// Data for evaluation. +/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +/// The available derived classes include . +/// +/// Evaluation target specifying the model config and parameters. +/// Display Name for evaluation. It helps to find the evaluation easily in AI Foundry. It does not need to be unique. +/// Description of the evaluation. It can be used to store additional information about the evaluation and is mutable. +/// Metadata containing createdBy and modifiedBy information. +/// Status of the evaluation. For upload: Failed or Completed. +/// Evaluation's tags. Unlike properties, tags are fully mutable. +/// Evaluation's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. +/// Evaluators to be used for the evaluation. +/// Outputs of the evaluation as a dictionary of IDs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}'}. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.EvaluationUpload EvaluationUpload(string id = (string)null, Azure.AI.Projects.1DP.InputData data = (Azure.AI.Projects.1DP.InputData)null,Azure.AI.Projects.1DP.EvaluationTarget target = (Azure.AI.Projects.1DP.EvaluationTarget)null,string displayName = null,string description = (string)null,Azure.AI.Projects.1DP.SystemData systemData = (Azure.AI.Projects.1DP.SystemData)null,string status = null, global::System.Collections.Generic.IDictionary tags = (global::System.Collections.Generic.IDictionary)null,IDictionary properties = null, global::System.Collections.Generic.IDictionary evaluators = (global::System.Collections.Generic.IDictionary)null,IDictionary outputs = null) +{ + tags ??= new Dictionary(); + properties ??= new global::System.Collections.Generic.Dictionary(); + evaluators ??= new Dictionary; + outputs ??= new global::System.Collections.Generic.Dictionary(); + + return new Azure.AI.Projects.1DP.EvaluationUpload( + id, + data, + target, + displayName, + description, + systemData, + status, + tags, + properties, + evaluators, + outputs, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. +/// Dataset type. +/// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted. +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.DatasetVersion DatasetVersion(string datasetUri = (string)null, string type = (string)null, bool? isReference = (bool?)null, string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.UnknownDatasetVersion( + datasetUri, + type == null ? ((Azure.AI.Projects.1DP.DatasetType)default) : new Azure.AI.Projects.1DP.DatasetType(type), + isReference, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. +/// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted. +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// Indicates OpenAI Purpose. FileDatasets created with this field will be compatible with OpenAI-specific features. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.FileDatasetVersion FileDatasetVersion(string datasetUri = (string)null, bool? isReference = (bool?)null, string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null, string openAIPurpose = (string)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.FileDatasetVersion( + datasetUri, + Azure.AI.Projects.1DP.DatasetType.UriFile, + isReference, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null, + openAIPurpose); +} + +/// Initializes a new instance of . +/// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. +/// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted. +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.FolderDatasetVersion FolderDatasetVersion(string datasetUri = (string)null, bool? isReference = (bool?)null, string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.FolderDatasetVersion( + datasetUri, + Azure.AI.Projects.1DP.DatasetType.UriFolder, + isReference, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// If PendingUploadId is not provided, a random GUID will be used. +/// Name of Azure blob storage connection to use for generating temporary SAS token. +/// TemporaryBlobReference is the only supported type. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PendingUploadRequest PendingUploadRequest(string pendingUploadId = (string)null, string connectionName = (string)null, Azure.AI.Projects.1DP.PendingUploadType pendingUploadType = default) +{ + return new Azure.AI.Projects.1DP.PendingUploadRequest(pendingUploadId, connectionName, pendingUploadType, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Container-level read, write, list SAS. +/// ID for this upload request. +/// Version of dataset to be created if user did not specify version when initially creating upload. +/// TemporaryBlobReference is the only supported type. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PendingUploadResponse PendingUploadResponse(Azure.AI.Projects.1DP.BlobReferenceForConsumption blobReferenceForConsumption = (Azure.AI.Projects.1DP.BlobReferenceForConsumption)null,string pendingUploadId = null,string datasetVersion = (string)null,Azure.AI.Projects.1DP.PendingUploadType pendingUploadType = default) +{ + return new Azure.AI.Projects.1DP.PendingUploadResponse(blobReferenceForConsumption, pendingUploadId, datasetVersion, pendingUploadType, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path. +/// ARM ID of the storage account to use. +/// Credential info to access the storage account. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.BlobReferenceForConsumption BlobReferenceForConsumption(string blobUri = (string)null, string storageAccountArmId = (string)null, Azure.AI.Projects.1DP.SasCredential credential = (Azure.AI.Projects.1DP.SasCredential)null) +{ + return new Azure.AI.Projects.1DP.BlobReferenceForConsumption(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// SAS uri. +/// Type of credential. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.SasCredential SasCredential(string sasUri = (string)null, Azure.AI.Projects.1DP.SasCredentialType type = default) +{ + return new Azure.AI.Projects.1DP.SasCredential(sasUri, type, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Credential info to access the storage account. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.AssetCredentialResponse AssetCredentialResponse(Azure.AI.Projects.1DP.BlobReferenceForConsumption blobReferenceForConsumption = (Azure.AI.Projects.1DP.BlobReferenceForConsumption)null) +{ + return new Azure.AI.Projects.1DP.AssetCredentialResponse(blobReferenceForConsumption, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Type of index. +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.Index Index(string type = (string)null, string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.UnknownIndex( + type == null ? ((Azure.AI.Projects.1DP.IndexType)default) : new Azure.AI.Projects.1DP.IndexType(type), + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// Name of connection to Azure AI Search. +/// Name of index in Azure AI Search resource to attach. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.AzureAISearchIndex AzureAISearchIndex(string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null, string connectionName = (string)null, string indexName = (string)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.AzureAISearchIndex( + Azure.AI.Projects.1DP.IndexType.AzureSearch, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null, + connectionName, + indexName); +} + +/// Initializes a new instance of . +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// Vector store id of managed index. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.ManagedAzureAISearchIndex ManagedAzureAISearchIndex(string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null, string vectorStoreId = (string)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.ManagedAzureAISearchIndex( + Azure.AI.Projects.1DP.IndexType.ManagedAzureSearch, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null, + vectorStoreId); +} + +/// Initializes a new instance of . +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// Name of connection to CosmosDB. +/// Name of the CosmosDB Database. +/// Name of CosmosDB Container. +/// Embedding model configuration. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.CosmosDBIndex CosmosDBIndex(string stage = (string)null, string id = (string)null, string name = (string)null, string version = (string)null, string description = (string)null, IDictionary tags = (IDictionary)null, string connectionName = (string)null, string databaseName = (string)null, string containerName = (string)null, Azure.AI.Projects.1DP.EmbeddingConfiguration embeddingConfiguration = (Azure.AI.Projects.1DP.EmbeddingConfiguration)null) +{ + tags ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.CosmosDBIndex( + Azure.AI.Projects.1DP.IndexType.CosmosDB, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null, + connectionName, + databaseName, + containerName, + embeddingConfiguration); +} + +/// Initializes a new instance of . +/// The type of the deployment. +/// Name of the deployment. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.Deployment Deployment(string type = (string)null, string name = (string)null) +{ + return new Azure.AI.Projects.1DP.UnknownDeployment(type == null ? ((Azure.AI.Projects.1DP.DeploymentType)default) : new Azure.AI.Projects.1DP.DeploymentType(type), name, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Name of the deployment. +/// Publisher-specific name of the deployed model. +/// Publisher-specific version of the deployed model. +/// Name of the deployed model's publisher. +/// Capabilities of deployed model. +/// Sku of the model deployment. +/// Name of the connection the deployment comes from. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.ModelDeployment ModelDeployment(string name = (string)null, string modelName = (string)null, string modelVersion = (string)null, string modelPublisher = (string)null, IReadOnlyDictionary capabilities = (IReadOnlyDictionary)null, Azure.AI.Projects.1DP.Sku sku = (Azure.AI.Projects.1DP.Sku)null,string connectionName = null) +{ + capabilities ??= new Dictionary(); + + return new Azure.AI.Projects.1DP.ModelDeployment( + Azure.AI.Projects.1DP.DeploymentType.ModelDeployment, + name, + serializedAdditionalRawData: null, + modelName, + modelVersion, + modelPublisher, + capabilities, + sku, + connectionName); +} + +/// Initializes a new instance of . +/// Sku capacity. +/// Sku family. +/// Sku name. +/// Sku size. +/// Sku tier. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.Sku Sku(long capacity = default, string family = (string)null, string name = (string)null, string size = (string)null, string tier = (string)null) +{ + return new Azure.AI.Projects.1DP.Sku( + capacity, + family, + name, + size, + tier, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Identifier of the red team. +/// Name of the red-team scan. +/// Number of simulation rounds. +/// List of attack strategies or nested lists of attack strategies. +/// Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result. +/// List of risk categories to generate attack objectives for. +/// Application scenario for the red team operation, to generate scenario specific attacks. +/// Red team's tags. Unlike properties, tags are fully mutable. +/// Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. +/// Status of the red-team. It is set by service and is read-only. +/// Read-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}', 'logId': 'azureai://accounts/{AccountName}/projects/{myproject}/datasets/{dataset-name}/versions/{dataset-version}' }. +/// Metadata containing createdBy and modifiedBy information. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.RedTeam RedTeam(string id = (string)null, string scanName = (string)null, int numTurns = default, System.Collections.Generic.IEnumerable attackStrategy = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.AttackStrategy>)null,bool simulationOnly = default, global::System.Collections.Generic.IEnumerable riskCategories = (global::System.Collections.Generic.IEnumerable)null,string applicationScenario = null, global::System.Collections.Generic.IDictionary tags = (global::System.Collections.Generic.IDictionary)null,IDictionary properties = null,string status = (string)null,IReadOnlyDictionary outputs = null, global::Azure.AI.Projects.1DP.SystemData systemData = (global::Azure.AI.Projects.1DP.SystemData)null) +{ + attackStrategy ??= new List; + riskCategories ??= new List; + tags ??= new Dictionary(); + properties ??= new global::System.Collections.Generic.Dictionary(); + outputs ??= new global::System.Collections.Generic.Dictionary(); + + return new Azure.AI.Projects.1DP.RedTeam( + id, + scanName, + numTurns, + attackStrategy?.ToList(), + simulationOnly, + riskCategories?.ToList(), + applicationScenario, + tags, + properties, + status, + outputs, + systemData, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Identifier of the red team. +/// Name of the red-team scan. +/// Number of simulation rounds. +/// List of attack strategies or nested lists of attack strategies. +/// Simulation-only or Simulation + Evaluation. Default false, if true the scan outputs conversation not evaluation result. +/// List of risk categories to generate attack objectives for. +/// Application scenario for the red team operation, to generate scenario specific attacks. +/// Red team's tags. Unlike properties, tags are fully mutable. +/// Red team's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed. +/// Status of the red-team. It is set by service and is read-only. +/// Read-only result outputs. Example: { 'evaluationResultId': 'azureai://accounts/{AccountName}/projects/{myproject}/evaluationresults/{name}/versions/{version}' }. +/// Metadata containing createdBy and modifiedBy information. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.RedTeamUpload RedTeamUpload(string id = (string)null, string scanName = (string)null, int? numTurns = (int?)null, System.Collections.Generic.IEnumerable attackStrategy = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.AttackStrategy>)null,bool? simulationOnly = null, global::System.Collections.Generic.IEnumerable riskCategories = (global::System.Collections.Generic.IEnumerable)null,string applicationScenario = null, global::System.Collections.Generic.IDictionary tags = (global::System.Collections.Generic.IDictionary)null,IDictionary properties = null,string status = (string)null,IReadOnlyDictionary outputs = null, global::Azure.AI.Projects.1DP.SystemData systemData = (global::Azure.AI.Projects.1DP.SystemData)null) +{ + attackStrategy ??= new List; + riskCategories ??= new List; + tags ??= new Dictionary(); + properties ??= new global::System.Collections.Generic.Dictionary(); + outputs ??= new global::System.Collections.Generic.Dictionary(); + + return new Azure.AI.Projects.1DP.RedTeamUpload( + id, + scanName, + numTurns, + attackStrategy?.ToList(), + simulationOnly, + riskCategories?.ToList(), + applicationScenario, + tags, + properties, + status, + outputs, + systemData, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The unique identifier. +/// The metadata. +/// List of sources. +/// The modality. +/// The messages. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.AttackObjective AttackObjective(string id = (string)null, Azure.AI.Projects.1DP.Metadata metadata = (Azure.AI.Projects.1DP.Metadata)null,IEnumerable source = null,string modality = (string)null,System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Message > messages = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Message >)null) +{ + source ??= new global::System.Collections.Generic.List(); + messages ??= new List; + + return new Azure.AI.Projects.1DP.AttackObjective( + id, + metadata, + source?.ToList(), + modality, + messages?.ToList(), + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// List of target harms. +/// The language. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.Metadata Metadata(System.Collections.Generic.IEnumerable targetHarms = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.TargetHarm>)null,string language = null) +{ + targetHarms ??= new List; + + return new Azure.AI.Projects.1DP.Metadata(targetHarms?.ToList(), language, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The risk type. +/// The risk sub type. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.TargetHarm TargetHarm(string riskType = (string)null, string riskSubType = (string)null) +{ + return new Azure.AI.Projects.1DP.TargetHarm(riskType, riskSubType, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The role. +/// The content. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.Message Message(string role = (string)null, string content = (string)null) +{ + return new Azure.AI.Projects.1DP.Message(role, content, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The location. +/// The OperationResult. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.LongRunningResponse LongRunningResponse(string location = (string)null, BinaryData operationResult = (BinaryData)null) +{ + return new Azure.AI.Projects.1DP.LongRunningResponse(location, operationResult, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// Type of Evaluation result. +/// Blob URI. +/// Asset stage. +/// A unique identifier for the asset, assetId probably?. +/// The name of the resource. +/// The version of the resource. +/// The asset description text. +/// Tag dictionary. Tags can be added, removed, and updated. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.EvaluationResult EvaluationResult(Azure.AI.Projects.1DP.ResultType? resultType = (Azure.AI.Projects.1DP.ResultType?)null,string blobUri = null,string stage = (string)null,string id = null,string name = (string)null,string version = null,string description = (string)null,IDictionary tags = null) +{ + tags ??= new global::System.Collections.Generic.Dictionary(); + + return new Azure.AI.Projects.1DP.EvaluationResult( + resultType, + blobUri, + stage, + id, + name, + version, + description, + tags, + serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The Connection items on this page. +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedConnection PagedConnection(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Connection>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedConnection(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The Evaluation items on this page. +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedEvaluation PagedEvaluation(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Evaluation>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedEvaluation(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// +/// The DatasetVersion items on this page +/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +/// The available derived classes include and . +/// +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedDatasetVersion PagedDatasetVersion(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.DatasetVersion>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedDatasetVersion(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// +/// The Index items on this page +/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +/// The available derived classes include , and . +/// +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedIndex PagedIndex(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Index>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedIndex(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// +/// The Deployment items on this page +/// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. +/// The available derived classes include . +/// +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedDeployment PagedDeployment(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.Deployment>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedDeployment(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The RedTeam items on this page. +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedRedTeam PagedRedTeam(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.RedTeam>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedRedTeam(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} + +/// Initializes a new instance of . +/// The EvaluationResult items on this page. +/// The link to the next page of items. +/// A new instance for mocking. +public static Azure.AI.Projects .1DP.PagedEvaluationResult PagedEvaluationResult(System.Collections.Generic.IEnumerable value = (System.Collections.Generic.IEnumerable < Azure.AI.Projects.1DP.EvaluationResult>)null,Uri nextLink = null) +{ + value ??= new List; + + return new Azure.AI.Projects.1DP.PagedEvaluationResult(value?.ToList(), nextLink, serializedAdditionalRawData: null); +} +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Connections.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Connections.cs new file mode 100644 index 000000000000..e0f36643c2d4 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Connections.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Projects.1DP +{ + +/// List all connections in the project, without populating connection credentials. +/// List connections of this specific type. +/// List connections that are default connections. +/// The number of result items to return. +/// The number of result items to skip. +/// The maximum number of result items per page. +/// The cancellation token to use. +/// +public virtual Azure.Pageable GetConnections(Projects.1DP.ConnectionType? connectionType = (Projects.1DP.ConnectionType?)null,bool? defaultConnection = null,int? maxCount = null,int? skip = null,int? maxpagesize = null, global::System.Threading.CancellationToken cancellationToken = default) +{ +RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; +HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConnectionsRequest(connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context); +HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConnectionsNextPageRequest(nextLink, connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context); +return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Projects.1DP.Connection.DeserializeConnection(e), ClientDiagnostics, _pipeline, "Connections.GetConnections", "value", "nextLink", maxpagesize, context); +} + +/// +/// [Protocol Method] List all connections in the project, without populating connection credentials +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// List connections of this specific type. Allowed values: "AzureOpenAI" | "AzureBlob" | "AzureStorageAccount" | "CognitiveSearch" | "CosmosDB" | "ApiKey" | "AppConfig" | "AppInsights" | "CustomKeys". +/// List connections that are default connections. +/// The number of result items to return. +/// The number of result items to skip. +/// The maximum number of result items per page. +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.AsyncPageable GetConnectionsAsync(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConnectionsRequest(connectionType, defaultConnection, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConnectionsNextPageRequest(nextLink, connectionType, defaultConnection, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Connections.GetConnections", "value", "nextLink", maxpagesize, context); +} + +/// +/// [Protocol Method] List all connections in the project, without populating connection credentials +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// List connections of this specific type. Allowed values: "AzureOpenAI" | "AzureBlob" | "AzureStorageAccount" | "CognitiveSearch" | "CosmosDB" | "ApiKey" | "AppConfig" | "AppInsights" | "CustomKeys". +/// List connections that are default connections. +/// The number of result items to return. +/// The number of result items to skip. +/// The maximum number of result items per page. +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.Pageable GetConnections(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetConnectionsRequest(connectionType, defaultConnection, maxCount, skip, pageSizeHint, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetConnectionsNextPageRequest(nextLink, connectionType, defaultConnection, maxCount, skip, pageSizeHint, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Connections.GetConnections", "value", "nextLink", maxpagesize, context); +} + +internal HttpMessage CreateGetConnectionRequest(string name, Azure.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("/connections/", false); + uri.AppendPath(name, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetWithCredentialsRequest(string name, Azure.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("/connections/", false); + uri.AppendPath(name, true); + uri.AppendPath("/withCredentials", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetConnectionsRequest(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, Azure.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("/connections", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (connectionType != null) + { + uri.AppendQuery("connectionType", connectionType, true); + } + if (defaultConnection != null) + { + uri.AppendQuery("defaultConnection", defaultConnection.Value, 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); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetConnectionsNextPageRequest(string nextLink, string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, Azure.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 Azure.RequestContext DefaultRequestContext = new Azure.RequestContext(); +internal static Azure.RequestContext FromCancellationToken(CancellationToken cancellationToken = default) +{ + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new Azure.RequestContext() { CancellationToken = cancellationToken }; +} + +private static ResponseClassifier _responseClassifier200; +private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Datasets.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Datasets.cs new file mode 100644 index 000000000000..ffb701210f7d --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Datasets.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Projects.1DP +{ + +/// List all versions of the given DatasetVersion. +/// The name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// is null. +/// is an empty string, and was expected to be non-empty. +/// +public virtual Azure.Pageable GetVersions(string name, int? maxCount = null, string skip = null, string tags = null, Projects.1DP.ListViewType? listViewType = (Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ +Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + +RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; +HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType?.ToString(), context); +HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType?.ToString(), context); +return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Projects.1DP.DatasetVersion.DeserializeDatasetVersion(e), ClientDiagnostics, _pipeline, "Datasets.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given DatasetVersion +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.AsyncPageable GetVersionsAsync(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Datasets.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given DatasetVersion +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.Pageable GetVersions(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Datasets.GetVersions", "value", "nextLink", context); +} + +/// List the latest version of each DatasetVersion. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.AsyncPageable GetLatestsAsync(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.DatasetVersion.DeserializeDatasetVersion(e), ClientDiagnostics, _pipeline, "Datasets.GetLatests", "value", "nextLink", context); +} + +/// List the latest version of each DatasetVersion. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.Pageable GetLatests(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.DatasetVersion.DeserializeDatasetVersion(e), ClientDiagnostics, _pipeline, "Datasets.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each DatasetVersion +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.AsyncPageable GetLatestsAsync(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Datasets.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each DatasetVersion +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.Pageable GetLatests(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Datasets.GetLatests", "value", "nextLink", context); +} + +internal HttpMessage CreateGetVersionsRequest(string name, int? maxCount, string skip, string tags, string listViewType, Azure.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("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetLatestsRequest(int? maxCount, string skip, string tags, string listViewType, Azure.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("/datasets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetVersionRequest(string name, string version, Azure.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("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateDeleteVersionRequest(string name, string version, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateCreateVersionRequest(string name, string version, RequestContent content, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + 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 CreateStartPendingUploadVersionRequest(string name, string version, RequestContent content, Azure.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("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/startPendingUpload", 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 CreateGetCredentialsRequest(string name, string version, RequestContent content, Azure.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("/datasets/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/credentials", 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 CreateGetVersionsNextPageRequest(string nextLink, string name, int? maxCount, string skip, string tags, string listViewType, Azure.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; +} + +internal HttpMessage CreateGetLatestsNextPageRequest(string nextLink, int? maxCount, string skip, string tags, string listViewType, Azure.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 Azure.RequestContext DefaultRequestContext = new Azure.RequestContext(); +internal static Azure.RequestContext FromCancellationToken(CancellationToken cancellationToken = default) +{ + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new Azure.RequestContext() { CancellationToken = cancellationToken }; +} + +private static ResponseClassifier _responseClassifier200; +private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); +private static ResponseClassifier _responseClassifier204; +private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); +private static ResponseClassifier _responseClassifier200201; +private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Connections.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Connections.xml new file mode 100644 index 000000000000..21802431bb98 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Connections.xml @@ -0,0 +1,353 @@ + + + + + +This sample shows how to call GetConnectionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = await client.GetConnectionAsync(""); +]]> +This sample shows how to call GetConnectionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = await client.GetConnectionAsync(""); +]]> + + + +This sample shows how to call GetConnection. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = client.GetConnection(""); +]]> +This sample shows how to call GetConnection with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = client.GetConnection(""); +]]> + + + +This sample shows how to call GetConnectionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetConnectionAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> +This sample shows how to call GetConnectionAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetConnectionAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetConnection and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetConnection("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> +This sample shows how to call GetConnection with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetConnection("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetWithCredentialsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = await client.GetWithCredentialsAsync(""); +]]> +This sample shows how to call GetWithCredentialsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = await client.GetWithCredentialsAsync(""); +]]> + + + +This sample shows how to call GetWithCredentials. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = client.GetWithCredentials(""); +]]> +This sample shows how to call GetWithCredentials with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Connection > response = client.GetWithCredentials(""); +]]> + + + +This sample shows how to call GetWithCredentialsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetWithCredentialsAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> +This sample shows how to call GetWithCredentialsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetWithCredentialsAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetWithCredentials and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetWithCredentials("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> +This sample shows how to call GetWithCredentials with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetWithCredentials("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").ToString()); +Console.WriteLine(result.GetProperty("isDefault").ToString()); +Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); +Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetConnectionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Connection item in client.GetConnectionsAsync()) +{ +} +]]> +This sample shows how to call GetConnectionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Connection item in client.GetConnectionsAsync(connectionType: AI.Projects.1DP.ConnectionType.AzureOpenAI, defaultConnection: true, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetConnections. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Connection item in client.GetConnections()) +{ +} +]]> +This sample shows how to call GetConnections with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Connection item in client.GetConnections(connectionType: AI.Projects.1DP.ConnectionType.AzureOpenAI, defaultConnection: true, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetConnectionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetConnectionsAsync((string)null, (bool?)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetConnectionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetConnectionsAsync("AzureOpenAI", true, 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetConnections and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetConnections((string)null, (bool?)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetConnections with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetConnections("AzureOpenAI", true, 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Datasets.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Datasets.xml new file mode 100644 index 000000000000..d337bdb5e23c --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Datasets.xml @@ -0,0 +1,821 @@ + + + + + +This sample shows how to call GetVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.GetVersionAsync("", ""); +]]> +This sample shows how to call GetVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.GetVersionAsync("", ""); +]]> + + + +This sample shows how to call GetVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.GetVersion("", ""); +]]> +This sample shows how to call GetVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.GetVersion("", ""); +]]> + + + +This sample shows how to call GetVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersionAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("isReference").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersion with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("isReference").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call DeleteVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", ""); +Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.CreateVersionAsync("", "", body); +]]> +This sample shows how to call CreateVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", "") +{ + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.CreateVersionAsync("", "", body); +]]> + + + +This sample shows how to call CreateVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", ""); +Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.CreateVersion("", "", body); +]]> +This sample shows how to call CreateVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", "") +{ + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.CreateVersion("", "", body); +]]> + + + +This sample shows how to call CreateVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "uri_file", + openAIPurpose = "", + datasetUri = "", +}); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersionAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("isReference").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CreateVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "uri_file", + openAIPurpose = "", + datasetUri = "", +}); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersion with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("datasetUri").ToString()); +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("isReference").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call StartPendingUploadVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadVersionAsync("", "", body); +]]> +This sample shows how to call StartPendingUploadVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest +{ + PendingUploadId = "", + ConnectionName = "", +}; +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadVersionAsync("", "", body); +]]> + + + +This sample shows how to call StartPendingUploadVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUploadVersion("", "", body); +]]> +This sample shows how to call StartPendingUploadVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest +{ + PendingUploadId = "", + ConnectionName = "", +}; +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUploadVersion("", "", body); +]]> + + + +This sample shows how to call StartPendingUploadVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadType = "TemporaryBlobReference", +}); +Response response = await client.StartPendingUploadVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> +This sample shows how to call StartPendingUploadVersionAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", +}); +Response response = await client.StartPendingUploadVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("datasetVersion").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> + + + +This sample shows how to call StartPendingUploadVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadType = "TemporaryBlobReference", +}); +Response response = client.StartPendingUploadVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> +This sample shows how to call StartPendingUploadVersion with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", +}); +Response response = client.StartPendingUploadVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("datasetVersion").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> + + + +This sample shows how to call GetCredentialsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.GetCredentialsAsync("", "", body); +]]> +This sample shows how to call GetCredentialsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.GetCredentialsAsync("", "", body); +]]> + + + +This sample shows how to call GetCredentials. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.GetCredentials("", "", body); +]]> +This sample shows how to call GetCredentials with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.GetCredentials("", "", body); +]]> + + + +This sample shows how to call GetCredentialsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.GetCredentialsAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> +This sample shows how to call GetCredentialsAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.GetCredentialsAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> + + + +This sample shows how to call GetCredentials and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.GetCredentials("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> +This sample shows how to call GetCredentials with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.GetCredentials("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> + + + +This sample shows how to call GetVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.DatasetVersion item in client.GetVersionsAsync("")) +{ +} +]]> +This sample shows how to call GetVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.DatasetVersion item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.DatasetVersion item in client.GetVersions("")) +{ +} +]]> +This sample shows how to call GetVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.DatasetVersion item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatestsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.DatasetVersion item in client.GetLatestsAsync()) +{ +} +]]> +This sample shows how to call GetLatestsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.DatasetVersion item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatests. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.DatasetVersion item in client.GetLatests()) +{ +} +]]> +This sample shows how to call GetLatests with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.DatasetVersion item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatestsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatestsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatests and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatests with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Deployments.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Deployments.xml new file mode 100644 index 000000000000..94c8a4018a79 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Deployments.xml @@ -0,0 +1,201 @@ + + + + + +This sample shows how to call GetDeploymentAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Deployment > response = await client.GetDeploymentAsync(""); +]]> +This sample shows how to call GetDeploymentAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Deployment > response = await client.GetDeploymentAsync(""); +]]> + + + +This sample shows how to call GetDeployment. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Deployment > response = client.GetDeployment(""); +]]> +This sample shows how to call GetDeployment with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Deployment > response = client.GetDeployment(""); +]]> + + + +This sample shows how to call GetDeploymentAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetDeploymentAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDeploymentAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetDeploymentAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetDeployment and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetDeployment("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> +This sample shows how to call GetDeployment with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetDeployment("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +]]> + + + +This sample shows how to call GetDeploymentsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Deployment item in client.GetDeploymentsAsync()) +{ +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Deployment item in client.GetDeploymentsAsync(modelPublisher: "", modelName: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeployments. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Deployment item in client.GetDeployments()) +{ +} +]]> +This sample shows how to call GetDeployments with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Deployment item in client.GetDeployments(modelPublisher: "", modelName: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetDeploymentsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDeploymentsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetDeploymentsAsync("", "", 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> + + + +This sample shows how to call GetDeployments and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetDeployments((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> +This sample shows how to call GetDeployments with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetDeployments("", "", 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/EvaluationResults.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/EvaluationResults.xml new file mode 100644 index 000000000000..bcc5e09c0e88 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/EvaluationResults.xml @@ -0,0 +1,801 @@ + + + + + +This sample shows how to call GetVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.GetVersionAsync("", ""); +]]> +This sample shows how to call GetVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.GetVersionAsync("", ""); +]]> + + + +This sample shows how to call GetVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.GetVersion("", ""); +]]> +This sample shows how to call GetVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.GetVersion("", ""); +]]> + + + +This sample shows how to call GetVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersionAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("ResultType").ToString()); +Console.WriteLine(result.GetProperty("BlobUri").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersion with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("ResultType").ToString()); +Console.WriteLine(result.GetProperty("BlobUri").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call DeleteVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult(); +Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.CreateVersionAsync("", "", body); +]]> +This sample shows how to call CreateVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult +{ + ResultType = AI.Projects.1DP.ResultType.Benchmark, + BlobUri = "", + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.CreateVersionAsync("", "", body); +]]> + + + +This sample shows how to call CreateVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult(); +Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.CreateVersion("", "", body); +]]> +This sample shows how to call CreateVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult +{ + ResultType = AI.Projects.1DP.ResultType.Benchmark, + BlobUri = "", + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.CreateVersion("", "", body); +]]> + + + +This sample shows how to call CreateVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersionAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + ResultType = "Benchmark", + BlobUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("ResultType").ToString()); +Console.WriteLine(result.GetProperty("BlobUri").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CreateVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersion with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + ResultType = "Benchmark", + BlobUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("ResultType").ToString()); +Console.WriteLine(result.GetProperty("BlobUri").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call StartPendingUploadAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadAsync("", "", body); +]]> +This sample shows how to call StartPendingUploadAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest +{ + PendingUploadId = "", + ConnectionName = "", +}; +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadAsync("", "", body); +]]> + + + +This sample shows how to call StartPendingUpload. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUpload("", "", body); +]]> +This sample shows how to call StartPendingUpload with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest +{ + PendingUploadId = "", + ConnectionName = "", +}; +Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUpload("", "", body); +]]> + + + +This sample shows how to call StartPendingUploadAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadType = "TemporaryBlobReference", +}); +Response response = await client.StartPendingUploadAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> +This sample shows how to call StartPendingUploadAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", +}); +Response response = await client.StartPendingUploadAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("datasetVersion").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> + + + +This sample shows how to call StartPendingUpload and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadType = "TemporaryBlobReference", +}); +Response response = client.StartPendingUpload("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> +This sample shows how to call StartPendingUpload with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", +}); +Response response = client.StartPendingUpload("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); +Console.WriteLine(result.GetProperty("datasetVersion").ToString()); +Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); +]]> + + + +This sample shows how to call FetchAssetCredentialsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.FetchAssetCredentialsAsync("", "", body); +]]> +This sample shows how to call FetchAssetCredentialsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.FetchAssetCredentialsAsync("", "", body); +]]> + + + +This sample shows how to call FetchAssetCredentials. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.FetchAssetCredentials("", "", body); +]]> +This sample shows how to call FetchAssetCredentials with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); +Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.FetchAssetCredentials("", "", body); +]]> + + + +This sample shows how to call FetchAssetCredentialsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + BlobUri = "", +}); +Response response = await client.FetchAssetCredentialsAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> +This sample shows how to call FetchAssetCredentialsAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + BlobUri = "", +}); +Response response = await client.FetchAssetCredentialsAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> + + + +This sample shows how to call FetchAssetCredentials and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + BlobUri = "", +}); +Response response = client.FetchAssetCredentials("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> +This sample shows how to call FetchAssetCredentials with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + BlobUri = "", +}); +Response response = client.FetchAssetCredentials("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); +Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); +]]> + + + +This sample shows how to call GetVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.EvaluationResult item in client.GetVersionsAsync("")) +{ +} +]]> +This sample shows how to call GetVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.EvaluationResult item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.EvaluationResult item in client.GetVersions("")) +{ +} +]]> +This sample shows how to call GetVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.EvaluationResult item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatestsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.EvaluationResult item in client.GetLatestsAsync()) +{ +} +]]> +This sample shows how to call GetLatestsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.EvaluationResult item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatests. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.EvaluationResult item in client.GetLatests()) +{ +} +]]> +This sample shows how to call GetLatests with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.EvaluationResult item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatestsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatestsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatests and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatests with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Evaluations.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Evaluations.xml new file mode 100644 index 000000000000..7f6440ff3461 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Evaluations.xml @@ -0,0 +1,1569 @@ + + + + + +This sample shows how to call GetEvaluationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.GetEvaluationAsync(""); +]]> +This sample shows how to call GetEvaluationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.GetEvaluationAsync(""); +]]> + + + +This sample shows how to call GetEvaluation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Evaluation > response = client.GetEvaluation(""); +]]> +This sample shows how to call GetEvaluation with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Evaluation > response = client.GetEvaluation(""); +]]> + + + +This sample shows how to call GetEvaluationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetEvaluationAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call GetEvaluationAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetEvaluationAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetEvaluation and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetEvaluation("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call GetEvaluation with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetEvaluation("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CreateRunAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary +{ + ["key"] = new Projects.1DP.EvaluatorConfiguration("") +}); +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.CreateRunAsync(evaluation); +]]> +This sample shows how to call CreateRunAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary +{ + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + DataMapping = + { + ["key"] = "" + }, + } +}) +{ + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + }, + DisplayName = "", + Description = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.CreateRunAsync(evaluation); +]]> + + + +This sample shows how to call CreateRun. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary +{ + ["key"] = new Projects.1DP.EvaluatorConfiguration("") +}); +Azure.Response < AI.Projects.1DP.Evaluation > response = client.CreateRun(evaluation); +]]> +This sample shows how to call CreateRun with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary +{ + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + DataMapping = + { + ["key"] = "" + }, + } +}) +{ + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + }, + DisplayName = "", + Description = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Evaluation > response = client.CreateRun(evaluation); +]]> + + + +This sample shows how to call CreateRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + evaluators = new + { + key = new + { + id = "", + }, + }, +}); +Response response = await client.CreateRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call CreateRunAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, +}); +Response response = await client.CreateRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CreateRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + evaluators = new + { + key = new + { + id = "", + }, + }, +}); +Response response = client.CreateRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call CreateRun with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, +}); +Response response = client.CreateRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CheckAnnotationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.CheckAnnotationAsync(); +]]> +This sample shows how to call CheckAnnotationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.CheckAnnotationAsync(); +]]> + + + +This sample shows how to call CheckAnnotation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.CheckAnnotation(); +]]> +This sample shows how to call CheckAnnotation with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.CheckAnnotation(); +]]> + + + +This sample shows how to call CheckAnnotationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.CheckAnnotationAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call CheckAnnotationAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.CheckAnnotationAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call CheckAnnotation and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.CheckAnnotation((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call CheckAnnotation with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.CheckAnnotation((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call SubmitAnnotationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( +"", +"", +new string[] { "" }, +new Projects.1DP.Content[] +{ + new Projects.1DP.Content(new BinaryData[] + { + BinaryData.FromObjectAsJson(new object()) + }) +}, +new string[] { "" }, +"", +"", +"", +"", +"", +""); +Response response = await client.SubmitAnnotationAsync(annotationDTO); +]]> +This sample shows how to call SubmitAnnotationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( +"", +"", +new string[] { "" }, +new Projects.1DP.Content[] +{ + new Projects.1DP.Content(new BinaryData[] + { + BinaryData.FromObjectAsJson(new object()) + }) +}, +new string[] { "" }, +"", +"", +"", +"", +"", +""); +Response response = await client.SubmitAnnotationAsync(annotationDTO); +]]> + + + +This sample shows how to call SubmitAnnotation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( +"", +"", +new string[] { "" }, +new Projects.1DP.Content[] +{ + new Projects.1DP.Content(new BinaryData[] + { + BinaryData.FromObjectAsJson(new object()) + }) +}, +new string[] { "" }, +"", +"", +"", +"", +"", +""); +Response response = client.SubmitAnnotation(annotationDTO); +]]> +This sample shows how to call SubmitAnnotation with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( +"", +"", +new string[] { "" }, +new Projects.1DP.Content[] +{ + new Projects.1DP.Content(new BinaryData[] + { + BinaryData.FromObjectAsJson(new object()) + }) +}, +new string[] { "" }, +"", +"", +"", +"", +"", +""); +Response response = client.SubmitAnnotation(annotationDTO); +]]> + + + +This sample shows how to call SubmitAnnotationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { + "" + }, + Contents = new object[] + { + new + { + Messages = new object[] + { + new object() + }, + } + }, + MetricList = new object[] + { + "" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", +}); +Response response = await client.SubmitAnnotationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call SubmitAnnotationAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { + "" + }, + Contents = new object[] + { + new + { + Messages = new object[] + { + new object() + }, + } + }, + MetricList = new object[] + { + "" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", +}); +Response response = await client.SubmitAnnotationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call SubmitAnnotation and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { + "" + }, + Contents = new object[] + { + new + { + Messages = new object[] + { + new object() + }, + } + }, + MetricList = new object[] + { + "" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", +}); +Response response = client.SubmitAnnotation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call SubmitAnnotation with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { + "" + }, + Contents = new object[] + { + new + { + Messages = new object[] + { + new object() + }, + } + }, + MetricList = new object[] + { + "" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", +}); +Response response = client.SubmitAnnotation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call OperationResultsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.OperationResultsAsync(""); +]]> +This sample shows how to call OperationResultsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.OperationResultsAsync(""); +]]> + + + +This sample shows how to call OperationResults. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.OperationResults(""); +]]> +This sample shows how to call OperationResults with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.OperationResults(""); +]]> + + + +This sample shows how to call OperationResultsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.OperationResultsAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("").ToString()); +]]> +This sample shows how to call OperationResultsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.OperationResultsAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("").ToString()); +]]> + + + +This sample shows how to call OperationResults and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.OperationResults("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("").ToString()); +]]> +This sample shows how to call OperationResults with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.OperationResults("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("").ToString()); +]]> + + + +This sample shows how to call UploadRunAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload(); +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.UploadRunAsync(evaluation); +]]> +This sample shows how to call UploadRunAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload +{ + Data = new Projects.1DP.InputDataset(""), + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + }, + DisplayName = "", + Description = "", + Status = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, + Evaluators = + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + DataMapping = + { + ["key"] = "" + }, + } + }, + Outputs = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Evaluation > response = await client.UploadRunAsync(evaluation); +]]> + + + +This sample shows how to call UploadRun. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload(); +Azure.Response < AI.Projects.1DP.Evaluation > response = client.UploadRun(evaluation); +]]> +This sample shows how to call UploadRun with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload +{ + Data = new Projects.1DP.InputDataset(""), + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + }, + DisplayName = "", + Description = "", + Status = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, + Evaluators = + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, + DataMapping = + { + ["key"] = "" + }, + } + }, + Outputs = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Evaluation > response = client.UploadRun(evaluation); +]]> + + + +This sample shows how to call UploadRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.UploadRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadRunAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, +}); +Response response = await client.UploadRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call UploadRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.UploadRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadRun with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, +}); +Response response = client.UploadRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call UploadUpdateRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.UploadUpdateRunAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadUpdateRunAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, +}); +Response response = await client.UploadUpdateRunAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call UploadUpdateRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.UploadUpdateRun("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadUpdateRun with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, +}); +Response response = client.UploadUpdateRun("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("displayName").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetEvaluationsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Evaluation item in client.GetEvaluationsAsync()) +{ +} +]]> +This sample shows how to call GetEvaluationsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Evaluation item in client.GetEvaluationsAsync(tags: "", properties: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetEvaluations. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Evaluation item in client.GetEvaluations()) +{ +} +]]> +This sample shows how to call GetEvaluations with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Evaluation item in client.GetEvaluations(tags: "", properties: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetEvaluationsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetEvaluationsAsync((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetEvaluationsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetEvaluationsAsync("", "", 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetEvaluations and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetEvaluations((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetEvaluations with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetEvaluations("", "", 1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Indexes.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Indexes.xml new file mode 100644 index 000000000000..2707485c4d59 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/Indexes.xml @@ -0,0 +1,547 @@ + + + + + +This sample shows how to call GetVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Index > response = await client.GetVersionAsync("", ""); +]]> +This sample shows how to call GetVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Index > response = await client.GetVersionAsync("", ""); +]]> + + + +This sample shows how to call GetVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Index > response = client.GetVersion("", ""); +]]> +This sample shows how to call GetVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.Index > response = client.GetVersion("", ""); +]]> + + + +This sample shows how to call GetVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersionAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetVersionAsync("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call GetVersion with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetVersion("", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call DeleteVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.DeleteVersionAsync("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call DeleteVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> +This sample shows how to call DeleteVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +Response response = client.DeleteVersion("", ""); + +Console.WriteLine(response.Status); +]]> + + + +This sample shows how to call CreateVersionAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", ""); +Azure.Response < AI.Projects.1DP.Index > response = await client.CreateVersionAsync("", "", body); +]]> +This sample shows how to call CreateVersionAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", "") +{ + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Index > response = await client.CreateVersionAsync("", "", body); +]]> + + + +This sample shows how to call CreateVersion. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", ""); +Azure.Response < AI.Projects.1DP.Index > response = client.CreateVersion("", "", body); +]]> +This sample shows how to call CreateVersion with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", "") +{ + Stage = "", + Description = "", + Tags = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.Index > response = client.CreateVersion("", "", body); +]]> + + + +This sample shows how to call CreateVersionAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "AzureSearch", + connectionName = "", + indexName = "", +}); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersionAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "AzureSearch", + connectionName = "", + indexName = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = await client.CreateVersionAsync("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call CreateVersion and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "AzureSearch", + connectionName = "", + indexName = "", +}); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +]]> +This sample shows how to call CreateVersion with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + type = "AzureSearch", + connectionName = "", + indexName = "", + stage = "", + description = "", + tags = new + { + key = "", + }, +}); +Response response = client.CreateVersion("", "", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("type").ToString()); +Console.WriteLine(result.GetProperty("stage").ToString()); +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("name").ToString()); +Console.WriteLine(result.GetProperty("version").ToString()); +Console.WriteLine(result.GetProperty("description").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +]]> + + + +This sample shows how to call GetVersionsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Index item in client.GetVersionsAsync("")) +{ +} +]]> +This sample shows how to call GetVersionsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Index item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersions. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Index item in client.GetVersions("")) +{ +} +]]> +This sample shows how to call GetVersions with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Index item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetVersionsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersionsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetVersions and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetVersions with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatestsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Index item in client.GetLatestsAsync()) +{ +} +]]> +This sample shows how to call GetLatestsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.Index item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatests. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Index item in client.GetLatests()) +{ +} +]]> +This sample shows how to call GetLatests with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.Index item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ +} +]]> + + + +This sample shows how to call GetLatestsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatestsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + +This sample shows how to call GetLatests and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); +} +]]> +This sample shows how to call GetLatests with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/RedTeams.xml b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/RedTeams.xml new file mode 100644 index 000000000000..b164e224b2ee --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Docs/RedTeams.xml @@ -0,0 +1,1611 @@ + + + + + +This sample shows how to call GetRedTeamAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.GetRedTeamAsync(""); +]]> +This sample shows how to call GetRedTeamAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.GetRedTeamAsync(""); +]]> + + + +This sample shows how to call GetRedTeam. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.RedTeam > response = client.GetRedTeam(""); +]]> +This sample shows how to call GetRedTeam with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < AI.Projects.1DP.RedTeam > response = client.GetRedTeam(""); +]]> + + + +This sample shows how to call GetRedTeamAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetRedTeamAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call GetRedTeamAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetRedTeamAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call GetRedTeam and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetRedTeam("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call GetRedTeam with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetRedTeam("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call CreateRunAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}); +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.CreateRunAsync(redTeam); +]]> +This sample shows how to call CreateRunAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}) +{ + ApplicationScenario = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.CreateRunAsync(redTeam); +]]> + + + +This sample shows how to call CreateRun. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}); +Azure.Response < AI.Projects.1DP.RedTeam > response = client.CreateRun(redTeam); +]]> +This sample shows how to call CreateRun with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}) +{ + ApplicationScenario = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.RedTeam > response = client.CreateRun(redTeam); +]]> + + + +This sample shows how to call CreateRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, +}); +Response response = await client.CreateRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call CreateRunAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = await client.CreateRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call CreateRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, +}); +Response response = client.CreateRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call CreateRun with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = client.CreateRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call UploadRunAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload(); +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.UploadRunAsync(redteam); +]]> +This sample shows how to call UploadRunAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload +{ + ScanName = "", + NumTurns = 1234, + AttackStrategy = { AI.Projects.1DP.AttackStrategy.Easy}, + SimulationOnly = true, + RiskCategories = { AI.Projects.1DP.RiskCategory.HateUnfairness}, + ApplicationScenario = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.RedTeam > response = await client.UploadRunAsync(redteam); +]]> + + + +This sample shows how to call UploadRun. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload(); +Azure.Response < AI.Projects.1DP.RedTeam > response = client.UploadRun(redteam); +]]> +This sample shows how to call UploadRun with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload +{ + ScanName = "", + NumTurns = 1234, + AttackStrategy = { AI.Projects.1DP.AttackStrategy.Easy}, + SimulationOnly = true, + RiskCategories = { AI.Projects.1DP.RiskCategory.HateUnfairness}, + ApplicationScenario = "", + Tags = + { + ["key"] = "" + }, + Properties = + { + ["key"] = "" + }, +}; +Azure.Response < AI.Projects.1DP.RedTeam > response = client.UploadRun(redteam); +]]> + + + +This sample shows how to call UploadRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.UploadRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadRunAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = await client.UploadRunAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call UploadRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.UploadRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadRun with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = client.UploadRun(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call UploadUpdateRunAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.UploadUpdateRunAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadUpdateRunAsync with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = await client.UploadUpdateRunAsync("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call UploadUpdateRun and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.UploadUpdateRun("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +]]> +This sample shows how to call UploadUpdateRun with all parameters and request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { + "easy" + }, + simulationOnly = true, + riskCategories = new object[] + { + "HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, +}); +Response response = client.UploadUpdateRun("", content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("id").ToString()); +Console.WriteLine(result.GetProperty("scanName").ToString()); +Console.WriteLine(result.GetProperty("numTurns").ToString()); +Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); +Console.WriteLine(result.GetProperty("simulationOnly").ToString()); +Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); +Console.WriteLine(result.GetProperty("applicationScenario").ToString()); +Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("status").ToString()); +Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); +Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +]]> + + + +This sample shows how to call GetJailBreakDatasetWithTypeAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.GetJailBreakDatasetWithTypeAsync(""); +]]> +This sample shows how to call GetJailBreakDatasetWithTypeAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.GetJailBreakDatasetWithTypeAsync(""); +]]> + + + +This sample shows how to call GetJailBreakDatasetWithType. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.GetJailBreakDatasetWithType(""); +]]> +This sample shows how to call GetJailBreakDatasetWithType with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.GetJailBreakDatasetWithType(""); +]]> + + + +This sample shows how to call GetJailBreakDatasetWithTypeAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetJailBreakDatasetWithTypeAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call GetJailBreakDatasetWithTypeAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetJailBreakDatasetWithTypeAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call GetJailBreakDatasetWithType and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetJailBreakDatasetWithType("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call GetJailBreakDatasetWithType with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetJailBreakDatasetWithType("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call GetAttackObjectivesAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = await client.GetAttackObjectivesAsync(); +]]> +This sample shows how to call GetAttackObjectivesAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = await client.GetAttackObjectivesAsync(riskTypes: new string[] { "" }, lang: "", strategy: ""); +]]> + + + +This sample shows how to call GetAttackObjectives. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = client.GetAttackObjectives(); +]]> +This sample shows how to call GetAttackObjectives with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = client.GetAttackObjectives(riskTypes: new string[] { "" }, lang: "", strategy: ""); +]]> + + + +This sample shows how to call GetAttackObjectivesAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetAttackObjectivesAsync((IEnumerable)null, (string)null, (string)null, (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].GetProperty("Id").ToString()); +Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); +Console.WriteLine(result[0].GetProperty("Modality").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].ToString()); +]]> +This sample shows how to call GetAttackObjectivesAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetAttackObjectivesAsync(new string[] { "" }, "", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].GetProperty("Id").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskType").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskSubType").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("Language").ToString()); +Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); +Console.WriteLine(result[0].GetProperty("Modality").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Role").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Content").ToString()); +]]> + + + +This sample shows how to call GetAttackObjectives and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetAttackObjectives((IEnumerable)null, (string)null, (string)null, (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].GetProperty("Id").ToString()); +Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); +Console.WriteLine(result[0].GetProperty("Modality").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].ToString()); +]]> +This sample shows how to call GetAttackObjectives with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetAttackObjectives(new string[] { "" }, "", "", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].GetProperty("Id").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskType").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskSubType").ToString()); +Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("Language").ToString()); +Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); +Console.WriteLine(result[0].GetProperty("Modality").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Role").ToString()); +Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Content").ToString()); +]]> + + + +This sample shows how to call GetJailBreakDatasetAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.GetJailBreakDatasetAsync(); +]]> +This sample shows how to call GetJailBreakDatasetAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = await client.GetJailBreakDatasetAsync(); +]]> + + + +This sample shows how to call GetJailBreakDataset. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.GetJailBreakDataset(); +]]> +This sample shows how to call GetJailBreakDataset with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response> response = client.GetJailBreakDataset(); +]]> + + + +This sample shows how to call GetJailBreakDatasetAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetJailBreakDatasetAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call GetJailBreakDatasetAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetJailBreakDatasetAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call GetJailBreakDataset and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetJailBreakDataset((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> +This sample shows how to call GetJailBreakDataset with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetJailBreakDataset((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result[0].ToString()); +]]> + + + +This sample shows how to call GetTemplateParametersWithTypeAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersWithTypeAsync(""); +]]> +This sample shows how to call GetTemplateParametersWithTypeAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersWithTypeAsync(""); +]]> + + + +This sample shows how to call GetTemplateParametersWithType. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersWithType(""); +]]> +This sample shows how to call GetTemplateParametersWithType with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersWithType(""); +]]> + + + +This sample shows how to call GetTemplateParametersWithTypeAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersWithTypeAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParametersWithTypeAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersWithTypeAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetTemplateParametersWithType and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersWithType("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParametersWithType with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersWithType("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetTemplateParametersAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersAsync(); +]]> +This sample shows how to call GetTemplateParametersAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersAsync(); +]]> + + + +This sample shows how to call GetTemplateParameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParameters(); +]]> +This sample shows how to call GetTemplateParameters with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParameters(); +]]> + + + +This sample shows how to call GetTemplateParametersAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParametersAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersAsync((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetTemplateParameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParameters((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParameters with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParameters((RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetTemplateParametersImageAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersImageAsync(""); +]]> +This sample shows how to call GetTemplateParametersImageAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersImageAsync(""); +]]> + + + +This sample shows how to call GetTemplateParametersImage. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersImage(""); +]]> +This sample shows how to call GetTemplateParametersImage with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersImage(""); +]]> + + + +This sample shows how to call GetTemplateParametersImageAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersImageAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParametersImageAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = await client.GetTemplateParametersImageAsync("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call GetTemplateParametersImage and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersImage("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> +This sample shows how to call GetTemplateParametersImage with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +Response response = client.GetTemplateParametersImage("", (RequestContext)null); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.ToString()); +]]> + + + +This sample shows how to call SubmitSimulationAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO(); +Azure.Response < AI.Projects.1DP.LongRunningResponse > response = await client.SubmitSimulationAsync(body); +]]> +This sample shows how to call SubmitSimulationAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO +{ + Headers = + { + ["key"] = "" + }, + Params = + { + ["key"] = "" + }, + TemplateParameters = + { + ["key"] = "" + }, + CustomizationParameters = new Projects.1DP.CustomizationParameters(new string[] { "" }) + { + ApplicationScenario = "", + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = AI.Projects.1DP.SimulationType.Default, + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", +}; +Azure.Response < AI.Projects.1DP.LongRunningResponse > response = await client.SubmitSimulationAsync(body); +]]> + + + +This sample shows how to call SubmitSimulation. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO(); +Azure.Response < AI.Projects.1DP.LongRunningResponse > response = client.SubmitSimulation(body); +]]> +This sample shows how to call SubmitSimulation with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO +{ + Headers = + { + ["key"] = "" + }, + Params = + { + ["key"] = "" + }, + TemplateParameters = + { + ["key"] = "" + }, + CustomizationParameters = new Projects.1DP.CustomizationParameters(new string[] { "" }) + { + ApplicationScenario = "", + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = AI.Projects.1DP.SimulationType.Default, + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", +}; +Azure.Response < AI.Projects.1DP.LongRunningResponse > response = client.SubmitSimulation(body); +]]> + + + +This sample shows how to call SubmitSimulationAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = await client.SubmitSimulationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("Location").ToString()); +Console.WriteLine(result.GetProperty("OperationResult").ToString()); +]]> +This sample shows how to call SubmitSimulationAsync with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + Headers = new + { + key = "", + }, + Params = new + { + key = "", + }, + TemplateParameters = new + { + key = "", + }, + CustomizationParameters = new + { + ApplicationScenario = "", + HarmCategories = new object[] + { + "" + }, + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = "Default", + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", +}); +Response response = await client.SubmitSimulationAsync(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("Location").ToString()); +Console.WriteLine(result.GetProperty("OperationResult").ToString()); +]]> + + + +This sample shows how to call SubmitSimulation and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new object()); +Response response = client.SubmitSimulation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("Location").ToString()); +Console.WriteLine(result.GetProperty("OperationResult").ToString()); +]]> +This sample shows how to call SubmitSimulation with all request content and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +using RequestContent content = RequestContent.Create(new +{ + Headers = new + { + key = "", + }, + Params = new + { + key = "", + }, + TemplateParameters = new + { + key = "", + }, + CustomizationParameters = new + { + ApplicationScenario = "", + HarmCategories = new object[] + { + "" + }, + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = "Default", + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", +}); +Response response = client.SubmitSimulation(content); + +JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; +Console.WriteLine(result.GetProperty("Location").ToString()); +Console.WriteLine(result.GetProperty("OperationResult").ToString()); +]]> + + + +This sample shows how to call GetRedTeamsAsync. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.RedTeam item in client.GetRedTeamsAsync()) +{ +} +]]> +This sample shows how to call GetRedTeamsAsync with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +await foreach (Projects.1DP.RedTeam item in client.GetRedTeamsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetRedTeams. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.RedTeam item in client.GetRedTeams()) +{ +} +]]> +This sample shows how to call GetRedTeams with all parameters. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +foreach (Projects.1DP.RedTeam item in client.GetRedTeams(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ +} +]]> + + + +This sample shows how to call GetRedTeamsAsync and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetRedTeamsAsync((int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetRedTeamsAsync with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +await foreach (BinaryData item in client.GetRedTeamsAsync(1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +} +]]> + + + +This sample shows how to call GetRedTeams and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetRedTeams((int?)null, (int?)null, (int?)null, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); +} +]]> +This sample shows how to call GetRedTeams with all parameters and parse the result. +"); +AzureKeyCredential credential = new AzureKeyCredential(""); +AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + +foreach (BinaryData item in client.GetRedTeams(1234, 1234, 1234, (RequestContext)null)) +{ + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); +} +]]> + + + \ No newline at end of file diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/EvaluationResults.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/EvaluationResults.cs new file mode 100644 index 000000000000..9083f2bc4e2c --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/EvaluationResults.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Projects.1DP +{ + +/// List all versions of the given EvaluationResult. +/// The name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// is null. +/// is an empty string, and was expected to be non-empty. +/// +public virtual Azure.Pageable GetVersions(string name, int? maxCount = null, string skip = null, string tags = null, Projects.1DP.ListViewType? listViewType = (Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ +Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + +RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; +HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType?.ToString(), context); +HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType?.ToString(), context); +return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Projects.1DP.EvaluationResult.DeserializeEvaluationResult(e), ClientDiagnostics, _pipeline, "EvaluationResults.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given EvaluationResult +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.AsyncPageable GetVersionsAsync(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EvaluationResults.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given EvaluationResult +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.Pageable GetVersions(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EvaluationResults.GetVersions", "value", "nextLink", context); +} + +/// List the latest version of each EvaluationResult. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.AsyncPageable GetLatestsAsync(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.EvaluationResult.DeserializeEvaluationResult(e), ClientDiagnostics, _pipeline, "EvaluationResults.GetLatests", "value", "nextLink", context); +} + +/// List the latest version of each EvaluationResult. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.Pageable GetLatests(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.EvaluationResult.DeserializeEvaluationResult(e), ClientDiagnostics, _pipeline, "EvaluationResults.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each EvaluationResult +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.AsyncPageable GetLatestsAsync(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EvaluationResults.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each EvaluationResult +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.Pageable GetLatests(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "EvaluationResults.GetLatests", "value", "nextLink", context); +} + +internal HttpMessage CreateGetVersionsRequest(string name, int? maxCount, string skip, string tags, string listViewType, Azure.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("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetLatestsRequest(int? maxCount, string skip, string tags, string listViewType, Azure.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("/evaluationResults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetVersionRequest(string name, string version, Azure.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("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateDeleteVersionRequest(string name, string version, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateCreateVersionRequest(string name, string version, RequestContent content, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + 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 CreateStartPendingUploadRequest(string name, string version, RequestContent content, Azure.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("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/startPendingUpload", 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 CreateFetchAssetCredentialsRequest(string name, string version, RequestContent content, Azure.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("/evaluationResults/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendPath("/fetchAssetCredentials", 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 CreateGetVersionsNextPageRequest(string nextLink, string name, int? maxCount, string skip, string tags, string listViewType, Azure.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; +} + +internal HttpMessage CreateGetLatestsNextPageRequest(string nextLink, int? maxCount, string skip, string tags, string listViewType, Azure.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 Azure.RequestContext DefaultRequestContext = new Azure.RequestContext(); +internal static Azure.RequestContext FromCancellationToken(CancellationToken cancellationToken = default) +{ + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new Azure.RequestContext() { CancellationToken = cancellationToken }; +} + +private static ResponseClassifier _responseClassifier200; +private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); +private static ResponseClassifier _responseClassifier204; +private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); +private static ResponseClassifier _responseClassifier200201; +private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Indexes.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Indexes.cs new file mode 100644 index 000000000000..45a55267512b --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/Indexes.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Projects.1DP +{ + +/// List all versions of the given Index. +/// The name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// is null. +/// is an empty string, and was expected to be non-empty. +/// +public virtual Azure.Pageable GetVersions(string name, int? maxCount = null, string skip = null, string tags = null, Projects.1DP.ListViewType? listViewType = (Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ +Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + +RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null; +HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType?.ToString(), context); +HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType?.ToString(), context); +return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Projects.1DP.Index.DeserializeIndex(e), ClientDiagnostics, _pipeline, "Indexes.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given Index +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.AsyncPageable GetVersionsAsync(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetVersions", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List all versions of the given Index +/// +/// +/// +/// 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 name of the resource. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// 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 Azure.Pageable GetVersions(string name, int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + Azure.AI.Projects.1DP.Argument.AssertNotNullOrEmpty(name, nameof(name)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetVersionsRequest(name, maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetVersionsNextPageRequest(nextLink, name, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetVersions", "value", "nextLink", context); +} + +/// List the latest version of each Index. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.AsyncPageable GetLatestsAsync(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.Index.DeserializeIndex(e), ClientDiagnostics, _pipeline, "Indexes.GetLatests", "value", "nextLink", context); +} + +/// List the latest version of each Index. +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. +/// The cancellation token to use. +/// +public virtual Azure.Pageable GetLatests(int? maxCount = null, string skip = null, string tags = null, Azure.AI.Projects.1DP.ListViewType? listViewType = (Azure.AI.Projects.1DP.ListViewType?)null,CancellationToken cancellationToken = default) +{ + Azure.RequestContext context = cancellationToken.CanBeCanceled ? new Azure.RequestContext { CancellationToken = cancellationToken } : null; + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType?.ToString(), context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType?.ToString(), context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Azure.AI.Projects.1DP.Index.DeserializeIndex(e), ClientDiagnostics, _pipeline, "Indexes.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each Index +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.AsyncPageable GetLatestsAsync(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetLatests", "value", "nextLink", context); +} + +/// +/// [Protocol Method] List the latest version of each Index +/// +/// +/// +/// 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. +/// +/// +/// +/// +/// Top count of results, top count cannot be greater than the page size. If topCount > page size, results with be default page size count will be returned. +/// Continuation token for pagination. +/// Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2. +/// [ListViewType.ActiveOnly, ListViewType.ArchivedOnly, ListViewType.All] View type for including/excluding (for example) archived entities. Allowed values: "ActiveOnly" | "ArchivedOnly" | "All". +/// The request context, which can override default behaviors of the client pipeline on a per-call basis. +/// 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 Azure.Pageable GetLatests(int? maxCount, string skip, string tags, string listViewType, Azure.RequestContext context) +{ + HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetLatestsRequest(maxCount, skip, tags, listViewType, context); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetLatestsNextPageRequest(nextLink, maxCount, skip, tags, listViewType, context); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Indexes.GetLatests", "value", "nextLink", context); +} + +internal HttpMessage CreateGetVersionsRequest(string name, int? maxCount, string skip, string tags, string listViewType, Azure.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("/indexes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetLatestsRequest(int? maxCount, string skip, string tags, string listViewType, Azure.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("/indexes", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (maxCount != null) + { + uri.AppendQuery("top", maxCount.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip, true); + } + if (tags != null) + { + uri.AppendQuery("tags", tags, true); + } + if (listViewType != null) + { + uri.AppendQuery("listViewType", listViewType, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateGetVersionRequest(string name, string version, Azure.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("/indexes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateDeleteVersionRequest(string name, string version, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier204); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; +} + +internal HttpMessage CreateCreateVersionRequest(string name, string version, RequestContent content, Azure.RequestContext context) +{ + var message = _pipeline.CreateMessage(context, ResponseClassifier200201); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/indexes/", false); + uri.AppendPath(name, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + 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 CreateGetVersionsNextPageRequest(string nextLink, string name, int? maxCount, string skip, string tags, string listViewType, Azure.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; +} + +internal HttpMessage CreateGetLatestsNextPageRequest(string nextLink, int? maxCount, string skip, string tags, string listViewType, Azure.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 Azure.RequestContext DefaultRequestContext = new Azure.RequestContext(); +internal static Azure.RequestContext FromCancellationToken(CancellationToken cancellationToken = default) +{ + if (!cancellationToken.CanBeCanceled) + { + return DefaultRequestContext; + } + + return new Azure.RequestContext() { CancellationToken = cancellationToken }; +} + +private static ResponseClassifier _responseClassifier200; +private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 }); +private static ResponseClassifier _responseClassifier204; +private static ResponseClassifier ResponseClassifier204 => _responseClassifier204 ??= new StatusCodeClassifier(stackalloc ushort[] { 204 }); +private static ResponseClassifier _responseClassifier200201; +private static ResponseClassifier ResponseClassifier200201 => _responseClassifier200201 ??= new StatusCodeClassifier(stackalloc ushort[] { 200, 201 }); +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.Serialization.cs new file mode 100644 index 000000000000..fd6666718597 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.Serialization.cs @@ -0,0 +1,126 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownBaseCredentials : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.BaseCredentials>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.BaseCredentials >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.BaseCredentials)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.BaseCredentials System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.BaseCredentials >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.BaseCredentials)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.BaseCredentials.DeserializeBaseCredentials(document.RootElement, options); + } + + internal static Projects.1DP.UnknownBaseCredentials DeserializeUnknownBaseCredentials(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AI.Projects.1DP.CredentialType authType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = new Projects.1DP.CredentialType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownBaseCredentials(authType, serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.BaseCredentials >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.BaseCredentials)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.BaseCredentials System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.BaseCredentials >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.BaseCredentials.DeserializeBaseCredentials(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.BaseCredentials)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownBaseCredentials FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownBaseCredentials.DeserializeUnknownBaseCredentials(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.BaseCredentials > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.cs new file mode 100644 index 000000000000..e4b8330e1e51 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownBaseCredentials.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of BaseCredentials. +internal partial class UnknownBaseCredentials : Projects.1DP.BaseCredentials +{ + /// Initializes a new instance of . + /// The type of credential used by the connection. + /// Keeps track of any properties unknown to the library. + internal UnknownBaseCredentials(Projects.1DP.CredentialType authType, IDictionary serializedAdditionalRawData) : base(authType, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownBaseCredentials() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.Serialization.cs new file mode 100644 index 000000000000..6f494ec1585e --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.Serialization.cs @@ -0,0 +1,175 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownConnection : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.Connection>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Connection >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Connection)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.Connection System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Connection >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Connection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.Connection.DeserializeConnection(document.RootElement, options); + } + + internal static Projects.1DP.UnknownConnection DeserializeUnknownConnection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string authType = "Unknown"; + string name = default; + AI.Projects.1DP.ConnectionType type = default; + string target = default; + bool isDefault = default; + AI.Projects.1DP.BaseCredentials credentials = default; + IReadOnlyDictionary metadata = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("authType"u8)) + { + authType = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Projects.1DP.ConnectionType(property.Value.GetString()); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDefault"u8)) + { + isDefault = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("credentials"u8)) + { + credentials = AI.Projects.1DP.BaseCredentials.DeserializeBaseCredentials(property.Value, options); + continue; + } + if (property.NameEquals("metadata"u8)) + { + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + metadata = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownConnection( + authType, + name, + type, + target, + isDefault, + credentials, + metadata, + serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Connection >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Connection)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.Connection System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Connection >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.Connection.DeserializeConnection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Connection)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownConnection FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownConnection.DeserializeUnknownConnection(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.Connection > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.cs new file mode 100644 index 000000000000..e5b63a1fdb7f --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownConnection.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of Connection. +internal partial class UnknownConnection : Projects.1DP.Connection +{ + /// Initializes a new instance of . + /// Discriminator property for Connection. + /// The name of the resource. + /// Category of the connection. + /// The connection URL to be used for this service. + /// Whether the connection is tagged as the default connection of its type. + /// + /// The credentials used by the connection + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , , , and . + /// + /// Metadata of the connection. + /// Keeps track of any properties unknown to the library. + internal UnknownConnection(string authType, string name, Projects.1DP.ConnectionType type, string target, bool isDefault, Projects.1DP.BaseCredentials credentials, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData) : base(authType, name, type, target, isDefault, credentials, metadata, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownConnection() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.Serialization.cs new file mode 100644 index 000000000000..fb420ac3abf4 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.Serialization.cs @@ -0,0 +1,197 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownDatasetVersion : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.DatasetVersion>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.DatasetVersion >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.DatasetVersion)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.DatasetVersion System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.DatasetVersion >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.DatasetVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.DatasetVersion.DeserializeDatasetVersion(document.RootElement, options); + } + + internal static Projects.1DP.UnknownDatasetVersion DeserializeUnknownDatasetVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string datasetUri = default; + AI.Projects.1DP.DatasetType type = "Unknown"; + bool? isReference = default; + string stage = default; + string id = default; + string name = default; + string version = default; + string description = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("datasetUri"u8)) + { + datasetUri = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new Projects.1DP.DatasetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("isReference"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isReference = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("stage"u8)) + { + stage = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownDatasetVersion( + datasetUri, + type, + isReference, + stage, + id, + name, + version, + description, + (tags ?? new Projects.1DP.ChangeTrackingDictionary()), + serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.DatasetVersion >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.DatasetVersion)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.DatasetVersion System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.DatasetVersion >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.DatasetVersion.DeserializeDatasetVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.DatasetVersion)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownDatasetVersion FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownDatasetVersion.DeserializeUnknownDatasetVersion(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.DatasetVersion > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.cs new file mode 100644 index 000000000000..8fd8d0c3b3fd --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDatasetVersion.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of DatasetVersion. +internal partial class UnknownDatasetVersion : Projects.1DP.DatasetVersion +{ + /// Initializes a new instance of . + /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330. + /// Dataset type. + /// Indicates if dataset is reference only or managed by dataset service. If true, the underlying data will be deleted when the dataset version is deleted. + /// Asset stage. + /// A unique identifier for the asset, assetId probably?. + /// The name of the resource. + /// The version of the resource. + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + internal UnknownDatasetVersion(string datasetUri, Projects.1DP.DatasetType type, bool? isReference, string stage, string id, string name, string version, string description, IDictionary tags, IDictionary serializedAdditionalRawData) : base(datasetUri, type, isReference, stage, id, name, version, description, tags, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDatasetVersion() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.Serialization.cs new file mode 100644 index 000000000000..c0e745bcabdb --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.Serialization.cs @@ -0,0 +1,132 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownDeployment : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.Deployment>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Deployment >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Deployment)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.Deployment System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Deployment >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Deployment)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.Deployment.DeserializeDeployment(document.RootElement, options); + } + + internal static Projects.1DP.UnknownDeployment DeserializeUnknownDeployment(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AI.Projects.1DP.DeploymentType type = "Unknown"; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new Projects.1DP.DeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownDeployment(type, name, serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Deployment >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Deployment)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.Deployment System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Deployment >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.Deployment.DeserializeDeployment(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Deployment)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownDeployment FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownDeployment.DeserializeUnknownDeployment(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.Deployment > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.cs new file mode 100644 index 000000000000..77d9dbf60a50 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownDeployment.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of Deployment. +internal partial class UnknownDeployment : Projects.1DP.Deployment +{ + /// Initializes a new instance of . + /// The type of the deployment. + /// Name of the deployment. + /// Keeps track of any properties unknown to the library. + internal UnknownDeployment(Projects.1DP.DeploymentType type, string name, IDictionary serializedAdditionalRawData) : base(type, name, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownDeployment() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.Serialization.cs new file mode 100644 index 000000000000..1706c8d5caf1 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.Serialization.cs @@ -0,0 +1,179 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownIndex : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.Index>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Index >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Index)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.Index System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Index >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.Index)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.Index.DeserializeIndex(document.RootElement, options); + } + + internal static Projects.1DP.UnknownIndex DeserializeUnknownIndex(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AI.Projects.1DP.IndexType type = "Unknown"; + string stage = default; + string id = default; + string name = default; + string version = default; + string description = default; + IDictionary tags = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new Projects.1DP.IndexType(property.Value.GetString()); + continue; + } + if (property.NameEquals("stage"u8)) + { + stage = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownIndex( + type, + stage, + id, + name, + version, + description, + (tags ?? new Projects.1DP.ChangeTrackingDictionary()), + serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Index >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Index)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.Index System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.Index >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.Index.DeserializeIndex(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.Index)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownIndex FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownIndex.DeserializeUnknownIndex(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.Index > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.cs new file mode 100644 index 000000000000..d20a830000ea --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownIndex.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of Index. +internal partial class UnknownIndex : Projects.1DP.Index +{ + /// Initializes a new instance of . + /// Type of index. + /// Asset stage. + /// A unique identifier for the asset, assetId probably?. + /// The name of the resource. + /// The version of the resource. + /// The asset description text. + /// Tag dictionary. Tags can be added, removed, and updated. + /// Keeps track of any properties unknown to the library. + internal UnknownIndex(Projects.1DP.IndexType type, string stage, string id, string name, string version, string description, IDictionary tags, IDictionary serializedAdditionalRawData) : base(type, stage, id, name, version, description, tags, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownIndex() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.Serialization.cs new file mode 100644 index 000000000000..6aa4e290534e --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.Serialization.cs @@ -0,0 +1,126 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownInputData : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.InputData>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.InputData >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.InputData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.InputData System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.InputData >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.InputData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.InputData.DeserializeInputData(document.RootElement, options); + } + + internal static Projects.1DP.UnknownInputData DeserializeUnknownInputData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownInputData(type, serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.InputData >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.InputData)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.InputData System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.InputData >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.InputData.DeserializeInputData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.InputData)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownInputData FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownInputData.DeserializeUnknownInputData(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.InputData > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.cs new file mode 100644 index 000000000000..47c75d22404c --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownInputData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of InputData. +internal partial class UnknownInputData : Projects.1DP.InputData +{ + /// Initializes a new instance of . + /// Type of the data. + /// Keeps track of any properties unknown to the library. + internal UnknownInputData(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownInputData() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.Serialization.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.Serialization.cs new file mode 100644 index 000000000000..e4999979dec2 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.Serialization.cs @@ -0,0 +1,126 @@ +// 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.AI.Projects.1DP +{ +internal partial class UnknownTargetModelConfig : IUtf8JsonSerializable, System.ClientModel.Primitives.IJsonModel +{ + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((System.ClientModel.Primitives.IJsonModel < AI.Projects.1DP.TargetModelConfig>)this).Write(writer, Projects.1DP.ModelSerializationExtensions.WireOptions); + + void System.ClientModel.Primitives.IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + this.JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.TargetModelConfig >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.TargetModelConfig)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + Projects.1DP.TargetModelConfig System.ClientModel.Primitives.IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.TargetModelConfig >)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AI.Projects.1DP.TargetModelConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return AI.Projects.1DP.TargetModelConfig.DeserializeTargetModelConfig(document.RootElement, options); + } + + internal static Projects.1DP.UnknownTargetModelConfig DeserializeUnknownTargetModelConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= AI.Projects.1DP.ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string type = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Projects.1DP.UnknownTargetModelConfig(type, serializedAdditionalRawData); + } + + BinaryData System.ClientModel.Primitives.IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.TargetModelConfig >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.TargetModelConfig)} does not support writing '{options.Format}' format."); + } + } + + Projects.1DP.TargetModelConfig System.ClientModel.Primitives.IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((System.ClientModel.Primitives.IPersistableModel < AI.Projects.1DP.TargetModelConfig >)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.TargetModelConfig.DeserializeTargetModelConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AI.Projects.1DP.TargetModelConfig)} does not support reading '{options.Format}' format."); + } + } + + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + + /// Deserializes the model from a raw response. + /// The response to deserialize the model from. + internal static new Projects.1DP.UnknownTargetModelConfig FromResponse(Response response) + { + using var document = JsonDocument.Parse(response.Content, AI.Projects.1DP.ModelSerializationExtensions.JsonDocumentOptions); + return AI.Projects.1DP.UnknownTargetModelConfig.DeserializeUnknownTargetModelConfig(document.RootElement); + } + + /// Convert into a . + internal override RequestContent ToRequestContent() + { + var content = new Projects.1DP.Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue < AI.Projects.1DP.TargetModelConfig > (this, AI.Projects.1DP.ModelSerializationExtensions.WireOptions); + return content; + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.cs new file mode 100644 index 000000000000..b3f76e40cba7 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/src/Generated/UnknownTargetModelConfig.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.AI.Projects.1DP +{ +/// Unknown version of TargetModelConfig. +internal partial class UnknownTargetModelConfig : Projects.1DP.TargetModelConfig +{ + /// Initializes a new instance of . + /// Type of the model configuration. + /// Keeps track of any properties unknown to the library. + internal UnknownTargetModelConfig(string type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + } + + /// Initializes a new instance of for deserialization. + internal UnknownTargetModelConfig() + { + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/src/Properties/AssemblyInfo.cs b/sdk/ai/Azure.AI.Projects.1DP/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..7d2f0243085a --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/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.AI.Projects.1DP.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/ai/Azure.AI.Projects.1DP/tests/Azure.AI.Projects.1DP.Tests.csproj b/sdk/ai/Azure.AI.Projects.1DP/tests/Azure.AI.Projects.1DP.Tests.csproj new file mode 100644 index 000000000000..ac4b04509d6d --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Azure.AI.Projects.1DP.Tests.csproj @@ -0,0 +1,20 @@ + + + $(RequiredTargetFrameworks) + + $(NoWarn);CS1591 + + + + + + + + + + + + + + + diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Connections.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Connections.cs new file mode 100644 index 000000000000..52b41b6700ed --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Connections.cs @@ -0,0 +1,402 @@ +// 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.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.1DP.Samples +{ +public partial class Samples_Connections +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnection_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetConnection("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnection_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetConnectionAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnection_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = client.GetConnection(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnection_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = await client.GetConnectionAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnection_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetConnection("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnection_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetConnectionAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnection_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = client.GetConnection(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnection_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = await client.GetConnectionAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetWithCredentials_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetWithCredentials("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetWithCredentials_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetWithCredentialsAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetWithCredentials_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = client.GetWithCredentials(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetWithCredentials_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = await client.GetWithCredentialsAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetWithCredentials_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetWithCredentials("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetWithCredentials_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetWithCredentialsAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetWithCredentials_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = client.GetWithCredentials(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetWithCredentials_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Connection > response = await client.GetWithCredentialsAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnections_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetConnections((string)null, (bool?)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnections_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetConnectionsAsync((string)null, (bool?)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnections_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Connection item in client.GetConnections()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnections_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Connection item in client.GetConnectionsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnections_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetConnections("AzureOpenAI", true, 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnections_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetConnectionsAsync("AzureOpenAI", true, 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").ToString()); + Console.WriteLine(result.GetProperty("isDefault").ToString()); + Console.WriteLine(result.GetProperty("credentials").GetProperty("authType").ToString()); + Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Connection_GetConnections_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Connection item in client.GetConnections(connectionType: AI.Projects.1DP.ConnectionType.AzureOpenAI, defaultConnection: true, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Connection_GetConnections_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Connections client = new Projects.1DP.AIProjectClient(endpoint, credential).GetConnectionsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Connection item in client.GetConnectionsAsync(connectionType: AI.Projects.1DP.ConnectionType.AzureOpenAI, defaultConnection: true, maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Datasets.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Datasets.cs new file mode 100644 index 000000000000..ca4f82008e3f --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Datasets.cs @@ -0,0 +1,913 @@ +// 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.AI.Projects.1DP.Samples +{ +public partial class Samples_Datasets +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_DeleteVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_DeleteVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_DeleteVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_DeleteVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_CreateVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + }); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_CreateVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + }); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_CreateVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", ""); + Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_CreateVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", ""); + Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_CreateVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_CreateVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "uri_file", + openAIPurpose = "", + datasetUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_CreateVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", "") + { + Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.DatasetVersion > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_CreateVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.DatasetVersion body = new Projects.1DP.FileDatasetVersion("", "") + { + Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.DatasetVersion > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_StartPendingUploadVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadType = "TemporaryBlobReference", + }); + Response response = client.StartPendingUploadVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_StartPendingUploadVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadType = "TemporaryBlobReference", + }); + Response response = await client.StartPendingUploadVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_StartPendingUploadVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUploadVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_StartPendingUploadVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_StartPendingUploadVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", + }); + Response response = client.StartPendingUploadVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("datasetVersion").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_StartPendingUploadVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", + }); + Response response = await client.StartPendingUploadVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("datasetVersion").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_StartPendingUploadVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest + { + PendingUploadId = "", +ConnectionName = "", +}; + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUploadVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_StartPendingUploadVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest + { + PendingUploadId = "", +ConnectionName = "", +}; + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetCredentials_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.GetCredentials("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetCredentials_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.GetCredentialsAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetCredentials_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.GetCredentials("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetCredentials_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.GetCredentialsAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetCredentials_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.GetCredentials("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetCredentials_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.GetCredentialsAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetCredentials_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.GetCredentials("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetCredentials_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.GetCredentialsRequest body = new Projects.1DP.GetCredentialsRequest(); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.GetCredentialsAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.DatasetVersion item in client.GetVersions("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.DatasetVersion item in client.GetVersionsAsync("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Datasets_GetVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.DatasetVersion item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Datasets_GetVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.DatasetVersion item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DatasetVersion_GetLatests_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DatasetVersion_GetLatests_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DatasetVersion_GetLatests_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.DatasetVersion item in client.GetLatests()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DatasetVersion_GetLatests_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.DatasetVersion item in client.GetLatestsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DatasetVersion_GetLatests_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DatasetVersion_GetLatests_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("datasetUri").ToString()); + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("isReference").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_DatasetVersion_GetLatests_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.DatasetVersion item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_DatasetVersion_GetLatests_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Datasets client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDatasetsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.DatasetVersion item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Deployments.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Deployments.cs new file mode 100644 index 000000000000..9c0358146713 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Deployments.cs @@ -0,0 +1,238 @@ +// 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.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.1DP.Samples +{ +public partial class Samples_Deployments +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployment_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetDeployment("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployment_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetDeploymentAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployment_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Deployment > response = client.GetDeployment(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployment_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Deployment > response = await client.GetDeploymentAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployment_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetDeployment("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployment_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetDeploymentAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployment_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Deployment > response = client.GetDeployment(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployment_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Deployment > response = await client.GetDeploymentAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployments_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetDeployments((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployments_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployments_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Deployment item in client.GetDeployments()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployments_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Deployment item in client.GetDeploymentsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployments_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetDeployments("", "", 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployments_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetDeploymentsAsync("", "", 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Deployment_GetDeployments_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Deployment item in client.GetDeployments(modelPublisher: "", modelName: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Deployment_GetDeployments_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Deployments client = new Projects.1DP.AIProjectClient(endpoint, credential).GetDeploymentsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Deployment item in client.GetDeploymentsAsync(modelPublisher: "", modelName: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_EvaluationResults.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_EvaluationResults.cs new file mode 100644 index 000000000000..b9d721739e4b --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_EvaluationResults.cs @@ -0,0 +1,893 @@ +// 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.AI.Projects.1DP.Samples +{ +public partial class Samples_EvaluationResults +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_DeleteVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_DeleteVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_DeleteVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_DeleteVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_CreateVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_CreateVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_CreateVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult(); + Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_CreateVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult(); + Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_CreateVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + ResultType = "Benchmark", + BlobUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_CreateVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + ResultType = "Benchmark", + BlobUri = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_CreateVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult + { + ResultType = AI.Projects.1DP.ResultType.Benchmark, +BlobUri = "", +Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.EvaluationResult > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_CreateVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationResult body = new Projects.1DP.EvaluationResult + { + ResultType = AI.Projects.1DP.ResultType.Benchmark, +BlobUri = "", +Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.EvaluationResult > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_StartPendingUpload_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadType = "TemporaryBlobReference", + }); + Response response = client.StartPendingUpload("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_StartPendingUpload_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadType = "TemporaryBlobReference", + }); + Response response = await client.StartPendingUploadAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_StartPendingUpload_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUpload("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_StartPendingUpload_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest(); + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_StartPendingUpload_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", + }); + Response response = client.StartPendingUpload("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("datasetVersion").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_StartPendingUpload_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + pendingUploadId = "", + connectionName = "", + pendingUploadType = "TemporaryBlobReference", + }); + Response response = await client.StartPendingUploadAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadId").ToString()); + Console.WriteLine(result.GetProperty("datasetVersion").ToString()); + Console.WriteLine(result.GetProperty("pendingUploadType").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_StartPendingUpload_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest + { + PendingUploadId = "", +ConnectionName = "", +}; + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = client.StartPendingUpload("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_StartPendingUpload_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.PendingUploadRequest body = new Projects.1DP.PendingUploadRequest + { + PendingUploadId = "", +ConnectionName = "", +}; + Azure.Response < AI.Projects.1DP.PendingUploadResponse > response = await client.StartPendingUploadAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_FetchAssetCredentials_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + BlobUri = "", + }); + Response response = client.FetchAssetCredentials("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_FetchAssetCredentials_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + BlobUri = "", + }); + Response response = await client.FetchAssetCredentialsAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_FetchAssetCredentials_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.FetchAssetCredentials("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_FetchAssetCredentials_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.FetchAssetCredentialsAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_FetchAssetCredentials_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + BlobUri = "", + }); + Response response = client.FetchAssetCredentials("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_FetchAssetCredentials_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + BlobUri = "", + }); + Response response = await client.FetchAssetCredentialsAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("blobUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("storageAccountArmId").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("sasUri").ToString()); + Console.WriteLine(result.GetProperty("blobReferenceForConsumption").GetProperty("credential").GetProperty("type").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_FetchAssetCredentials_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = client.FetchAssetCredentials("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_FetchAssetCredentials_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AssetCredentialRequest body = new Projects.1DP.AssetCredentialRequest(""); + Azure.Response < AI.Projects.1DP.AssetCredentialResponse > response = await client.FetchAssetCredentialsAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.EvaluationResult item in client.GetVersions("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.EvaluationResult item in client.GetVersionsAsync("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResults_GetVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.EvaluationResult item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResults_GetVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.EvaluationResult item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResult_GetLatests_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResult_GetLatests_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResult_GetLatests_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.EvaluationResult item in client.GetLatests()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResult_GetLatests_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.EvaluationResult item in client.GetLatestsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResult_GetLatests_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResult_GetLatests_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("ResultType").ToString()); + Console.WriteLine(result.GetProperty("BlobUri").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_EvaluationResult_GetLatests_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.EvaluationResult item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_EvaluationResult_GetLatests_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.EvaluationResults client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationResultsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.EvaluationResult item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Evaluations.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Evaluations.cs new file mode 100644 index 000000000000..c688e243cfef --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Evaluations.cs @@ -0,0 +1,1674 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.1DP.Samples +{ +public partial class Samples_Evaluations +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluation_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetEvaluation("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetEvaluationAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Evaluation > response = client.GetEvaluation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.GetEvaluationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluation_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetEvaluation("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetEvaluationAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Evaluation > response = client.GetEvaluation(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.GetEvaluationAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CreateRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + evaluators = new + { + key = new + { + id = "", + }, + }, + }); + Response response = client.CreateRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CreateRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + evaluators = new + { + key = new + { + id = "", + }, + }, + }); + Response response = await client.CreateRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CreateRun_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + }); + Azure.Response < AI.Projects.1DP.Evaluation > response = client.CreateRun(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CreateRun_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + }); + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.CreateRunAsync(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CreateRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + }); + Response response = client.CreateRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CreateRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + }); + Response response = await client.CreateRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CreateRun_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +DataMapping = + { + ["key"] = "" + }, +} + }) +{ + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) +{ + ModelParams = +{ + ["key"] = BinaryData.FromObjectAsJson(new object()) +}, +}, +DisplayName = "", +Description = "", +Tags = +{ + ["key"] = "" +}, +Properties = +{ + ["key"] = "" +}, +}; + Azure.Response < AI.Projects.1DP.Evaluation > response = client.CreateRun(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CreateRun_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Evaluation evaluation = new Projects.1DP.Evaluation(new Projects.1DP.InputDataset(""), new Dictionary + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +DataMapping = + { + ["key"] = "" + }, +} + }) +{ + Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) +{ + ModelParams = +{ + ["key"] = BinaryData.FromObjectAsJson(new object()) +}, +}, +DisplayName = "", +Description = "", +Tags = +{ + ["key"] = "" +}, +Properties = +{ + ["key"] = "" +}, +}; + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.CreateRunAsync(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CheckAnnotation_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.CheckAnnotation((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CheckAnnotation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.CheckAnnotationAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CheckAnnotation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.CheckAnnotation(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CheckAnnotation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.CheckAnnotationAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CheckAnnotation_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.CheckAnnotation((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CheckAnnotation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.CheckAnnotationAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_CheckAnnotation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.CheckAnnotation(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_CheckAnnotation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.CheckAnnotationAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_SubmitAnnotation_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { +"" + }, + Contents = new object[] + { +new +{ +Messages = new object[] +{ +new object() +}, +} + }, + MetricList = new object[] + { +"" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", + }); + Response response = client.SubmitAnnotation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_SubmitAnnotation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { +"" + }, + Contents = new object[] + { +new +{ +Messages = new object[] +{ +new object() +}, +} + }, + MetricList = new object[] + { +"" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", + }); + Response response = await client.SubmitAnnotationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_SubmitAnnotation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( + "", + "", + new string[] { "" }, + new Projects.1DP.Content[] + { + new Projects.1DP.Content(new BinaryData[] + { +BinaryData.FromObjectAsJson(new object()) + }) + }, + new string[] { "" }, + "", + "", + "", + "", + "", + ""); + Response response = client.SubmitAnnotation(annotationDTO); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_SubmitAnnotation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( + "", + "", + new string[] { "" }, + new Projects.1DP.Content[] + { + new Projects.1DP.Content(new BinaryData[] + { +BinaryData.FromObjectAsJson(new object()) + }) + }, + new string[] { "" }, + "", + "", + "", + "", + "", + ""); + Response response = await client.SubmitAnnotationAsync(annotationDTO); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_SubmitAnnotation_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { +"" + }, + Contents = new object[] + { +new +{ +Messages = new object[] +{ +new object() +}, +} + }, + MetricList = new object[] + { +"" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", + }); + Response response = client.SubmitAnnotation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_SubmitAnnotation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + AnnotationTask = "", + ContentType = "", + UserTextList = new object[] + { +"" + }, + Contents = new object[] + { +new +{ +Messages = new object[] +{ +new object() +}, +} + }, + MetricList = new object[] + { +"" + }, + PromptVersion = "", + UserAgent = "", + PartnerId = "", + ModelId = "", + InferenceType = "", + ClientRequestId = "", + }); + Response response = await client.SubmitAnnotationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_SubmitAnnotation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( + "", + "", + new string[] { "" }, + new Projects.1DP.Content[] + { + new Projects.1DP.Content(new BinaryData[] + { +BinaryData.FromObjectAsJson(new object()) + }) + }, + new string[] { "" }, + "", + "", + "", + "", + "", + ""); + Response response = client.SubmitAnnotation(annotationDTO); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_SubmitAnnotation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.AnnotationDTO annotationDTO = new Projects.1DP.AnnotationDTO( + "", + "", + new string[] { "" }, + new Projects.1DP.Content[] + { + new Projects.1DP.Content(new BinaryData[] + { +BinaryData.FromObjectAsJson(new object()) + }) + }, + new string[] { "" }, + "", + "", + "", + "", + "", + ""); + Response response = await client.SubmitAnnotationAsync(annotationDTO); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_OperationResults_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.OperationResults("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_OperationResults_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.OperationResultsAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_OperationResults_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.OperationResults(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_OperationResults_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.OperationResultsAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_OperationResults_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.OperationResults("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_OperationResults_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.OperationResultsAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_OperationResults_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.OperationResults(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_OperationResults_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.OperationResultsAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.UploadRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.UploadRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadRun_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload(); + Azure.Response < AI.Projects.1DP.Evaluation > response = client.UploadRun(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadRun_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload(); + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.UploadRunAsync(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, + }); + Response response = client.UploadRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, + }); + Response response = await client.UploadRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadRun_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload + { + Data = new Projects.1DP.InputDataset(""), +Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +}, +DisplayName = "", +Description = "", +Status = "", +Tags = + { + ["key"] = "" + }, +Properties = + { + ["key"] = "" + }, +Evaluators = + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +DataMapping = + { + ["key"] = "" + }, +} + }, +Outputs = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.Evaluation > response = client.UploadRun(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadRun_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.EvaluationUpload evaluation = new Projects.1DP.EvaluationUpload + { + Data = new Projects.1DP.InputDataset(""), +Target = new Projects.1DP.EvaluationTarget("", new Projects.1DP.AOAIModelConfig("", "", "")) + { + ModelParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +}, +DisplayName = "", +Description = "", +Status = "", +Tags = + { + ["key"] = "" + }, +Properties = + { + ["key"] = "" + }, +Evaluators = + { + ["key"] = new Projects.1DP.EvaluatorConfiguration("") + { + InitParams = + { + ["key"] = BinaryData.FromObjectAsJson(new object()) + }, +DataMapping = + { + ["key"] = "" + }, +} + }, +Outputs = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.Evaluation > response = await client.UploadRunAsync(evaluation); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadUpdateRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.UploadUpdateRun("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadUpdateRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.UploadUpdateRunAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluations_UploadUpdateRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, + }); + Response response = client.UploadUpdateRun("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluations_UploadUpdateRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + data = new + { + type = "dataset", + id = "", + }, + target = new + { + systemMessage = "", + modelConfig = new + { + azureEndpoint = "", + apiKey = "", + azureDeployment = "", + type = "AOAI", + }, + modelParams = new + { + key = new object(), + }, + }, + displayName = "", + description = "", + status = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + evaluators = new + { + key = new + { + id = "", + initParams = new + { + key = new object(), + }, + dataMapping = new + { + key = "", + }, + }, + }, + outputs = new + { + key = "", + }, + }); + Response response = await client.UploadUpdateRunAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluations_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetEvaluations((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluations_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetEvaluationsAsync((string)null, (string)null, (int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluations_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Evaluation item in client.GetEvaluations()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluations_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Evaluation item in client.GetEvaluationsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluations_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetEvaluations("", "", 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluations_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetEvaluationsAsync("", "", 1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("data").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("systemMessage").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelConfig").GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("target").GetProperty("modelParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("displayName").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("initParams").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("evaluators").GetProperty("").GetProperty("dataMapping").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Evaluation_GetEvaluations_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Evaluation item in client.GetEvaluations(tags: "", properties: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Evaluation_GetEvaluations_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Evaluations client = new Projects.1DP.AIProjectClient(endpoint, credential).GetEvaluationsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Evaluation item in client.GetEvaluationsAsync(tags: "", properties: "", maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Indexes.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Indexes.cs new file mode 100644 index 000000000000..49c4b253c164 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_Indexes.cs @@ -0,0 +1,615 @@ +// 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.AI.Projects.1DP.Samples +{ +public partial class Samples_Indexes +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Index > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Index > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetVersion("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetVersionAsync("", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Index > response = client.GetVersion("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.Index > response = await client.GetVersionAsync("", ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_DeleteVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_DeleteVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_DeleteVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = client.DeleteVersion("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_DeleteVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.DeleteVersionAsync("", ""); + + Console.WriteLine(response.Status); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateVersion_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "AzureSearch", + connectionName = "", + indexName = "", + }); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateVersion_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "AzureSearch", + connectionName = "", + indexName = "", + }); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateVersion_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", ""); + Azure.Response < AI.Projects.1DP.Index > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateVersion_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", ""); + Azure.Response < AI.Projects.1DP.Index > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateVersion_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "AzureSearch", + connectionName = "", + indexName = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = client.CreateVersion("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateVersion_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + type = "AzureSearch", + connectionName = "", + indexName = "", + stage = "", + description = "", + tags = new + { + key = "", + }, + }); + Response response = await client.CreateVersionAsync("", "", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_CreateVersion_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", "") + { + Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.Index > response = client.CreateVersion("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_CreateVersion_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.Index body = new Projects.1DP.AzureAISearchIndex("", "") + { + Stage = "", +Description = "", +Tags = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.Index > response = await client.CreateVersionAsync("", "", body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersions_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersions_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", (int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersions_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Index item in client.GetVersions("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersions_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Index item in client.GetVersionsAsync("")) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersions_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetVersions("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersions_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetVersionsAsync("", 1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Indexes_GetVersions_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Index item in client.GetVersions("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Indexes_GetVersions_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Index item in client.GetVersionsAsync("", maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Index_GetLatests_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Index_GetLatests_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync((int?)null, (string)null, (string)null, (string)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Index_GetLatests_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Index item in client.GetLatests()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Index_GetLatests_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Index item in client.GetLatestsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Index_GetLatests_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetLatests(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Index_GetLatests_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetLatestsAsync(1234, "", "", "ActiveOnly", (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("type").ToString()); + Console.WriteLine(result.GetProperty("stage").ToString()); + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("name").ToString()); + Console.WriteLine(result.GetProperty("version").ToString()); + Console.WriteLine(result.GetProperty("description").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_Index_GetLatests_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.Index item in client.GetLatests(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_Index_GetLatests_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.Indexes client = new Projects.1DP.AIProjectClient(endpoint, credential).GetIndexesClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.Index item in client.GetLatestsAsync(maxCount: 1234, skip: "", tags: "", listViewType: AI.Projects.1DP.ListViewType.ActiveOnly)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_RedTeams.cs b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_RedTeams.cs new file mode 100644 index 000000000000..945d4d2e78a2 --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tests/Generated/Samples/Samples_RedTeams.cs @@ -0,0 +1,1764 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.AI.Projects.1DP.Samples +{ +public partial class Samples_RedTeams +{ + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeam_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetRedTeam("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeam_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetRedTeamAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeam_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.RedTeam > response = client.GetRedTeam(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeam_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.GetRedTeamAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeam_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetRedTeam("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeam_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetRedTeamAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeam_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.RedTeam > response = client.GetRedTeam(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeam_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.GetRedTeamAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_CreateRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + }); + Response response = client.CreateRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_CreateRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + }); + Response response = await client.CreateRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_CreateRun_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}); + Azure.Response < AI.Projects.1DP.RedTeam > response = client.CreateRun(redTeam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_CreateRun_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}); + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.CreateRunAsync(redTeam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_CreateRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = client.CreateRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_CreateRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = await client.CreateRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_CreateRun_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}) +{ + ApplicationScenario = "", +Tags = +{ + ["key"] = "" +}, +Properties = +{ + ["key"] = "" +}, +}; + Azure.Response < AI.Projects.1DP.RedTeam > response = client.CreateRun(redTeam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_CreateRun_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeam redTeam = new Projects.1DP.RedTeam("", 1234, new Projects.1DP.AttackStrategy[]{ AI.Projects.1DP.AttackStrategy.Easy}, true, new Projects.1DP.RiskCategory[]{ AI.Projects.1DP.RiskCategory.HateUnfairness}) +{ + ApplicationScenario = "", +Tags = +{ + ["key"] = "" +}, +Properties = +{ + ["key"] = "" +}, +}; + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.CreateRunAsync(redTeam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.UploadRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.UploadRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadRun_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload(); + Azure.Response < AI.Projects.1DP.RedTeam > response = client.UploadRun(redteam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadRun_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload(); + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.UploadRunAsync(redteam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = client.UploadRun(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = await client.UploadRunAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadRun_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload + { + ScanName = "", +NumTurns = 1234, +AttackStrategy = { AI.Projects.1DP.AttackStrategy.Easy}, +SimulationOnly = true, +RiskCategories = { AI.Projects.1DP.RiskCategory.HateUnfairness}, +ApplicationScenario = "", +Tags = + { + ["key"] = "" + }, +Properties = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.RedTeam > response = client.UploadRun(redteam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadRun_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.RedTeamUpload redteam = new Projects.1DP.RedTeamUpload + { + ScanName = "", +NumTurns = 1234, +AttackStrategy = { AI.Projects.1DP.AttackStrategy.Easy}, +SimulationOnly = true, +RiskCategories = { AI.Projects.1DP.RiskCategory.HateUnfairness}, +ApplicationScenario = "", +Tags = + { + ["key"] = "" + }, +Properties = + { + ["key"] = "" + }, +}; + Azure.Response < AI.Projects.1DP.RedTeam > response = await client.UploadRunAsync(redteam); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadUpdateRun_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.UploadUpdateRun("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadUpdateRun_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.UploadUpdateRunAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_UploadUpdateRun_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = client.UploadUpdateRun("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_UploadUpdateRun_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + scanName = "", + numTurns = 1234, + attackStrategy = new object[] + { +"easy" + }, + simulationOnly = true, + riskCategories = new object[] + { +"HateUnfairness" + }, + applicationScenario = "", + tags = new + { + key = "", + }, + properties = new + { + key = "", + }, + }); + Response response = await client.UploadUpdateRunAsync("", content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDatasetWithType_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetJailBreakDatasetWithType("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDatasetWithType_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetJailBreakDatasetWithTypeAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDatasetWithType_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.GetJailBreakDatasetWithType(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDatasetWithType_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.GetJailBreakDatasetWithTypeAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDatasetWithType_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetJailBreakDatasetWithType("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDatasetWithType_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetJailBreakDatasetWithTypeAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDatasetWithType_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.GetJailBreakDatasetWithType(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDatasetWithType_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.GetJailBreakDatasetWithTypeAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetAttackObjectives_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetAttackObjectives((IEnumerable)null, (string)null, (string)null, (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].GetProperty("Id").ToString()); + Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); + Console.WriteLine(result[0].GetProperty("Modality").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetAttackObjectives_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetAttackObjectivesAsync((IEnumerable)null, (string)null, (string)null, (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].GetProperty("Id").ToString()); + Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); + Console.WriteLine(result[0].GetProperty("Modality").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetAttackObjectives_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = client.GetAttackObjectives(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetAttackObjectives_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = await client.GetAttackObjectivesAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetAttackObjectives_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetAttackObjectives(new string[] { "" }, "", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].GetProperty("Id").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskType").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskSubType").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("Language").ToString()); + Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); + Console.WriteLine(result[0].GetProperty("Modality").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Role").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Content").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetAttackObjectives_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetAttackObjectivesAsync(new string[] { "" }, "", "", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].GetProperty("Id").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskType").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("TargetHarms")[0].GetProperty("RiskSubType").ToString()); + Console.WriteLine(result[0].GetProperty("Metadata").GetProperty("Language").ToString()); + Console.WriteLine(result[0].GetProperty("Source")[0].ToString()); + Console.WriteLine(result[0].GetProperty("Modality").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Role").ToString()); + Console.WriteLine(result[0].GetProperty("Messages")[0].GetProperty("Content").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetAttackObjectives_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = client.GetAttackObjectives(riskTypes: new string[] { "" }, lang: "", strategy: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetAttackObjectives_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Azure.Response < System.Collections.Generic.IReadOnlyList < AI.Projects.1DP.AttackObjective >> response = await client.GetAttackObjectivesAsync(riskTypes: new string[] { "" }, lang: "", strategy: ""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDataset_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetJailBreakDataset((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDataset_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetJailBreakDatasetAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDataset_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.GetJailBreakDataset(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDataset_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.GetJailBreakDatasetAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDataset_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetJailBreakDataset((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDataset_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetJailBreakDatasetAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result[0].ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetJailBreakDataset_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = client.GetJailBreakDataset(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetJailBreakDataset_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response> response = await client.GetJailBreakDatasetAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersWithType_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersWithType("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersWithType_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersWithTypeAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersWithType_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersWithType(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersWithType_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersWithTypeAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersWithType_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersWithType("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersWithType_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersWithTypeAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersWithType_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersWithType(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersWithType_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersWithTypeAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParameters_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParameters((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParameters_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParameters_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParameters(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParameters_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParameters_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParameters((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParameters_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersAsync((RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParameters_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParameters(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParameters_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersAsync(); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersImage_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersImage("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersImage_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersImageAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersImage_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersImage(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersImage_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersImageAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersImage_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersImage("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersImage_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersImageAsync("", (RequestContext)null); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_GetTemplateParametersImage_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = client.GetTemplateParametersImage(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_GetTemplateParametersImage_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + Response response = await client.GetTemplateParametersImageAsync(""); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_SubmitSimulation_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = client.SubmitSimulation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("Location").ToString()); + Console.WriteLine(result.GetProperty("OperationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_SubmitSimulation_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new object()); + Response response = await client.SubmitSimulationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("Location").ToString()); + Console.WriteLine(result.GetProperty("OperationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_SubmitSimulation_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO(); + Azure.Response < AI.Projects.1DP.LongRunningResponse > response = client.SubmitSimulation(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_SubmitSimulation_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO(); + Azure.Response < AI.Projects.1DP.LongRunningResponse > response = await client.SubmitSimulationAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_SubmitSimulation_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + Headers = new + { + key = "", + }, + Params = new + { + key = "", + }, + TemplateParameters = new + { + key = "", + }, + CustomizationParameters = new + { + ApplicationScenario = "", + HarmCategories = new object[] + { +"" + }, + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = "Default", + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", + }); + Response response = client.SubmitSimulation(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("Location").ToString()); + Console.WriteLine(result.GetProperty("OperationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_SubmitSimulation_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + using RequestContent content = RequestContent.Create(new + { + Headers = new + { + key = "", + }, + Params = new + { + key = "", + }, + TemplateParameters = new + { + key = "", + }, + CustomizationParameters = new + { + ApplicationScenario = "", + HarmCategories = new object[] + { +"" + }, + }, + Json = "", + Url = "", + TemplateKey = "", + SimulationType = "Default", + IsMicrosoftTenant = true, + SubscriptionId = "", + ResourceGroupName = "", + WorkspaceName = "", + }); + Response response = await client.SubmitSimulationAsync(content); + + JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement; + Console.WriteLine(result.GetProperty("Location").ToString()); + Console.WriteLine(result.GetProperty("OperationResult").ToString()); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeams_SubmitSimulation_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO + { + Headers = + { + ["key"] = "" + }, +Params = + { + ["key"] = "" + }, +TemplateParameters = + { + ["key"] = "" + }, +CustomizationParameters = new Projects.1DP.CustomizationParameters(new string[] { "" }) + { + ApplicationScenario = "", +}, +Json = "", +Url = "", +TemplateKey = "", +SimulationType = AI.Projects.1DP.SimulationType.Default, +IsMicrosoftTenant = true, +SubscriptionId = "", +ResourceGroupName = "", +WorkspaceName = "", +}; + Azure.Response < AI.Projects.1DP.LongRunningResponse > response = client.SubmitSimulation(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeams_SubmitSimulation_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + AI.Projects.1DP.SimulationDTO body = new Projects.1DP.SimulationDTO + { + Headers = + { + ["key"] = "" + }, +Params = + { + ["key"] = "" + }, +TemplateParameters = + { + ["key"] = "" + }, +CustomizationParameters = new Projects.1DP.CustomizationParameters(new string[] { "" }) + { + ApplicationScenario = "", +}, +Json = "", +Url = "", +TemplateKey = "", +SimulationType = AI.Projects.1DP.SimulationType.Default, +IsMicrosoftTenant = true, +SubscriptionId = "", +ResourceGroupName = "", +WorkspaceName = "", +}; + Azure.Response < AI.Projects.1DP.LongRunningResponse > response = await client.SubmitSimulationAsync(body); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeams_ShortVersion() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetRedTeams((int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeams_ShortVersion_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetRedTeamsAsync((int?)null, (int?)null, (int?)null, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeams_ShortVersion_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.RedTeam item in client.GetRedTeams()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeams_ShortVersion_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.RedTeam item in client.GetRedTeamsAsync()) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeams_AllParameters() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + foreach (BinaryData item in client.GetRedTeams(1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeams_AllParameters_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + await foreach (BinaryData item in client.GetRedTeamsAsync(1234, 1234, 1234, (RequestContext)null)) + { + JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement; + Console.WriteLine(result.GetProperty("id").ToString()); + Console.WriteLine(result.GetProperty("scanName").ToString()); + Console.WriteLine(result.GetProperty("numTurns").ToString()); + Console.WriteLine(result.GetProperty("attackStrategy")[0].ToString()); + Console.WriteLine(result.GetProperty("simulationOnly").ToString()); + Console.WriteLine(result.GetProperty("riskCategories")[0].ToString()); + Console.WriteLine(result.GetProperty("applicationScenario").ToString()); + Console.WriteLine(result.GetProperty("tags").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("properties").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("status").ToString()); + Console.WriteLine(result.GetProperty("outputs").GetProperty("").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdAt").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdBy").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("createdByType").ToString()); + Console.WriteLine(result.GetProperty("systemData").GetProperty("lastModifiedAt").ToString()); + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public void Example_RedTeam_GetRedTeams_AllParameters_Convenience() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + foreach (Projects.1DP.RedTeam item in client.GetRedTeams(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Example_RedTeam_GetRedTeams_AllParameters_Convenience_Async() + { + Uri endpoint = new Uri(""); + AzureKeyCredential credential = new AzureKeyCredential(""); + AI.Projects.1DP.RedTeams client = new Projects.1DP.AIProjectClient(endpoint, credential).GetRedTeamsClient(apiVersion: "2025-05-15-preview"); + + await foreach (Projects.1DP.RedTeam item in client.GetRedTeamsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234)) +{ + } + } +} +} diff --git a/sdk/ai/Azure.AI.Projects.1DP/tsp-location.yaml b/sdk/ai/Azure.AI.Projects.1DP/tsp-location.yaml new file mode 100644 index 000000000000..7367780d316a --- /dev/null +++ b/sdk/ai/Azure.AI.Projects.1DP/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/ai/Azure.AI.Projects +commit: 639316b73d9f9b089db94d7038a49cce43c3cae8 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/ai/ci.yml b/sdk/ai/ci.yml new file mode 100644 index 000000000000..010807d7a6e1 --- /dev/null +++ b/sdk/ai/ci.yml @@ -0,0 +1,35 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/ai + - sdk/ai/ci.yml + - sdk/ai/Azure.AI.Projects.1DP + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/ai + - sdk/ai/ci.yml + - sdk/ai/Azure.AI.Projects.1DP + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: ai + ArtifactName: packages + Artifacts: + - name: Azure.AI.Projects.1DP + safeName: AzureAIProjects1DP