diff --git a/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln b/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln
new file mode 100644
index 000000000000..2df9b830370b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/Azure.AI.Projects.OneDP.sln
@@ -0,0 +1,54 @@
+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.OneDP", "src\Azure.AI.Projects.OneDP.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+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.OneDP/CHANGELOG.md b/sdk/ai/Azure.AI.Projects.OneDP/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/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.OneDP/Directory.Build.props b/sdk/ai/Azure.AI.Projects.OneDP/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/README.md b/sdk/ai/Azure.AI.Projects.OneDP/README.md
new file mode 100644
index 000000000000..20b92c86af3c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/README.md
@@ -0,0 +1,107 @@
+# Azure.AI.Projects.OneDP client library for .NET
+
+Azure.AI.Projects.OneDP 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.OneDP/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.OneDP --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.OneDP/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
+
+
\ No newline at end of file
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj b/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj
new file mode 100644
index 000000000000..fe2c1d298c6c
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Azure.AI.Projects.OneDP.csproj
@@ -0,0 +1,20 @@
+
+
+ This is the Azure.AI.Projects.OneDP client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.AI.Projects.OneDP for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.AI.Projects.OneDP
+ $(RequiredTargetFrameworks)
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs
new file mode 100644
index 000000000000..462b231f02e5
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClient.cs
@@ -0,0 +1,183 @@
+// 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.OneDP
+{
+ // 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 "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AIProjectClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AIProjectClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AIProjectClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AIProjectClient.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry 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, AIProjectClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new 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 "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry 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, AIProjectClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new 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 Internal _cachedInternal;
+ private ServicePatterns _cachedServicePatterns;
+
+ /// Initializes a new instance of Internal.
+ public virtual Internal GetInternalClient()
+ {
+ return Volatile.Read(ref _cachedInternal) ?? Interlocked.CompareExchange(ref _cachedInternal, new Internal(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint), null) ?? _cachedInternal;
+ }
+
+ /// Initializes a new instance of ServicePatterns.
+ public virtual ServicePatterns GetServicePatternsClient()
+ {
+ return Volatile.Read(ref _cachedServicePatterns) ?? Interlocked.CompareExchange(ref _cachedServicePatterns, new 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 Connections GetConnectionsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new 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 Evaluations GetEvaluationsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new 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 Datasets GetDatasetsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new 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 Indexes GetIndexesClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new 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 Deployments GetDeploymentsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new 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 RedTeams GetRedTeamsClient(string apiVersion = "2025-05-15-preview")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new RedTeams(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs
new file mode 100644
index 000000000000..f6707b6813f3
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectClientOptions.cs
@@ -0,0 +1,40 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Client options for AIProjectClient.
+ public partial class AIProjectClientOptions : ClientOptions
+ {
+ private const ServiceVersion LatestVersion = ServiceVersion.V2025_05_15_Preview;
+
+ /// The version of the service to use.
+ public enum ServiceVersion
+ {
+ /// Service version "2025-05-01".
+ V2025_05_01 = 1,
+ /// Service version "2025-05-15-preview".
+ V2025_05_15_Preview = 2,
+ }
+
+ internal string Version { get; }
+
+ /// Initializes new instance of AIProjectClientOptions.
+ public AIProjectClientOptions(ServiceVersion version = LatestVersion)
+ {
+ Version = version switch
+ {
+ ServiceVersion.V2025_05_01 => "2025-05-01",
+ ServiceVersion.V2025_05_15_Preview => "2025-05-15-preview",
+ _ => throw new NotSupportedException()
+ };
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs
new file mode 100644
index 000000000000..f8893ce70ec9
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPClientBuilderExtensions.cs
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure;
+using Azure.AI.Projects.OneDP;
+using Azure.Core.Extensions;
+
+namespace Microsoft.Extensions.Azure
+{
+ /// Extension methods to add to client builder.
+ public static partial class AIProjectsOneDPClientBuilderExtensions
+ {
+ /// Registers a instance.
+ /// The builder to register with.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// A credential used to authenticate to an Azure Service.
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential)
+ where TBuilder : IAzureClientFactoryBuilder
+ {
+ return builder.RegisterClientFactory((options) => new AIProjectClient(endpoint, credential, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, Uri endpoint)
+ where TBuilder : IAzureClientFactoryBuilderWithCredential
+ {
+ return builder.RegisterClientFactory((options, cred) => new AIProjectClient(endpoint, cred, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// The configuration values.
+ public static IAzureClientBuilder AddAIProjectClient(this TBuilder builder, TConfiguration configuration)
+ where TBuilder : IAzureClientFactoryBuilderWithConfiguration
+ {
+ return builder.RegisterClientFactory(configuration);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs
new file mode 100644
index 000000000000..2a27a258ea16
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AIProjectsOneDPModelFactory.cs
@@ -0,0 +1,417 @@
+// 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.OneDP
+{
+ /// Model factory for models.
+ public static partial class AIProjectsOneDPModelFactory
+ {
+ /// 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.
+ /// A new instance for mocking.
+ public static Connection Connection(string authType = null, string name = null, ConnectionType type = default, string target = null, bool isDefault = default, BaseCredentials credentials = null, IReadOnlyDictionary metadata = null)
+ {
+ metadata ??= new Dictionary();
+
+ return new UnknownConnection(
+ authType,
+ name,
+ type,
+ target,
+ isDefault,
+ credentials,
+ metadata,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// API Key.
+ /// A new instance for mocking.
+ public static ApiKeyCredentials ApiKeyCredentials(string apiKey = null)
+ {
+ return new ApiKeyCredentials(CredentialType.ApiKey, serializedAdditionalRawData: null, apiKey);
+ }
+
+ /// Initializes a new instance of .
+ /// SAS token.
+ /// A new instance for mocking.
+ public static SASCredentials SASCredentials(string sasToken = null)
+ {
+ return new SASCredentials(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 .
+ ///
+ /// 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.
+ /// 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.
+ /// A new instance for mocking.
+ public static Evaluation Evaluation(string id = null, InputData data = null, string displayName = null, string description = null, string status = null, IDictionary tags = null, IDictionary properties = null, IDictionary evaluators = null)
+ {
+ tags ??= new Dictionary();
+ properties ??= new Dictionary();
+ evaluators ??= new Dictionary();
+
+ return new Evaluation(
+ id,
+ data,
+ displayName,
+ description,
+ status,
+ tags,
+ properties,
+ evaluators,
+ 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 DatasetVersion DatasetVersion(string datasetUri = null, string type = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new UnknownDatasetVersion(
+ datasetUri,
+ type == null ? default : new 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 FileDatasetVersion FileDatasetVersion(string datasetUri = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string openAIPurpose = null)
+ {
+ tags ??= new Dictionary();
+
+ return new FileDatasetVersion(
+ datasetUri,
+ 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 FolderDatasetVersion FolderDatasetVersion(string datasetUri = null, bool? isReference = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new FolderDatasetVersion(
+ datasetUri,
+ 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 PendingUploadRequest PendingUploadRequest(string pendingUploadId = null, string connectionName = null, PendingUploadType pendingUploadType = default)
+ {
+ return new 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 PendingUploadResponse PendingUploadResponse(BlobReferenceForConsumption blobReferenceForConsumption = null, string pendingUploadId = null, string datasetVersion = null, PendingUploadType pendingUploadType = default)
+ {
+ return new 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 BlobReferenceForConsumption BlobReferenceForConsumption(string blobUri = null, string storageAccountArmId = null, SasCredential credential = null)
+ {
+ return new BlobReferenceForConsumption(blobUri, storageAccountArmId, credential, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// SAS uri.
+ /// Type of credential.
+ /// A new instance for mocking.
+ public static SasCredential SasCredential(string sasUri = null, SasCredentialType type = default)
+ {
+ return new SasCredential(sasUri, type, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Credential info to access the storage account.
+ /// A new instance for mocking.
+ public static AssetCredentialResponse AssetCredentialResponse(BlobReferenceForConsumption blobReferenceForConsumption = null)
+ {
+ return new 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 Index Index(string type = null, string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null)
+ {
+ tags ??= new Dictionary();
+
+ return new UnknownIndex(
+ type == null ? default : new 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 AzureAISearchIndex AzureAISearchIndex(string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string connectionName = null, string indexName = null)
+ {
+ tags ??= new Dictionary();
+
+ return new AzureAISearchIndex(
+ 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 ManagedAzureAISearchIndex ManagedAzureAISearchIndex(string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string vectorStoreId = null)
+ {
+ tags ??= new Dictionary();
+
+ return new ManagedAzureAISearchIndex(
+ 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 CosmosDBIndex CosmosDBIndex(string stage = null, string id = null, string name = null, string version = null, string description = null, IDictionary tags = null, string connectionName = null, string databaseName = null, string containerName = null, EmbeddingConfiguration embeddingConfiguration = null)
+ {
+ tags ??= new Dictionary();
+
+ return new CosmosDBIndex(
+ 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 Deployment Deployment(string type = null, string name = null)
+ {
+ return new UnknownDeployment(type == null ? default : new 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 ModelDeployment ModelDeployment(string name = null, string modelName = null, string modelVersion = null, string modelPublisher = null, IReadOnlyDictionary capabilities = null, Sku sku = null, string connectionName = null)
+ {
+ capabilities ??= new Dictionary();
+
+ return new ModelDeployment(
+ 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 Sku Sku(long capacity = default, string family = null, string name = null, string size = null, string tier = null)
+ {
+ return new 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.
+ /// A new instance for mocking.
+ public static RedTeam RedTeam(string id = null, string scanName = null, int numTurns = default, IEnumerable attackStrategies = null, bool simulationOnly = default, IEnumerable riskCategories = null, string applicationScenario = null, IDictionary tags = null, IDictionary properties = null, string status = null)
+ {
+ attackStrategies ??= new List();
+ riskCategories ??= new List();
+ tags ??= new Dictionary();
+ properties ??= new Dictionary();
+
+ return new RedTeam(
+ id,
+ scanName,
+ numTurns,
+ attackStrategies?.ToList(),
+ simulationOnly,
+ riskCategories?.ToList(),
+ applicationScenario,
+ tags,
+ properties,
+ status,
+ serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.Serialization.cs
new file mode 100644
index 000000000000..e4250e8bacbb
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.Serialization.cs
@@ -0,0 +1,137 @@
+// 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.OneDP
+{
+ public partial class ApiKeyCredentials : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ApiKeyCredentials)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (options.Format != "W" && Optional.IsDefined(ApiKey))
+ {
+ writer.WritePropertyName("apiKey"u8);
+ writer.WriteStringValue(ApiKey);
+ }
+ }
+
+ ApiKeyCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(ApiKeyCredentials)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeApiKeyCredentials(document.RootElement, options);
+ }
+
+ internal static ApiKeyCredentials DeserializeApiKeyCredentials(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string apiKey = default;
+ CredentialType authType = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("apiKey"u8))
+ {
+ apiKey = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("authType"u8))
+ {
+ authType = new CredentialType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ApiKeyCredentials(authType, serializedAdditionalRawData, apiKey);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(ApiKeyCredentials)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ApiKeyCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeApiKeyCredentials(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ApiKeyCredentials)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new ApiKeyCredentials FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeApiKeyCredentials(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.cs
new file mode 100644
index 000000000000..b72ad938e4d7
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ApiKeyCredentials.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.OneDP
+{
+ /// API Key Credential definition.
+ public partial class ApiKeyCredentials : BaseCredentials
+ {
+ /// Initializes a new instance of .
+ internal ApiKeyCredentials()
+ {
+ AuthType = CredentialType.ApiKey;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of credential used by the connection.
+ /// Keeps track of any properties unknown to the library.
+ /// API Key.
+ internal ApiKeyCredentials(CredentialType authType, IDictionary serializedAdditionalRawData, string apiKey) : base(authType, serializedAdditionalRawData)
+ {
+ ApiKey = apiKey;
+ }
+
+ /// API Key.
+ public string ApiKey { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.Serialization.cs
new file mode 100644
index 000000000000..5cbfc0bdfa5b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.Serialization.cs
@@ -0,0 +1,142 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ public partial class AssetCredentialResponse : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetCredentialResponse)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("blobReferenceForConsumption"u8);
+ writer.WriteObjectValue(BlobReferenceForConsumption, options);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ AssetCredentialResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AssetCredentialResponse)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssetCredentialResponse(document.RootElement, options);
+ }
+
+ internal static AssetCredentialResponse DeserializeAssetCredentialResponse(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ BlobReferenceForConsumption blobReferenceForConsumption = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("blobReferenceForConsumption"u8))
+ {
+ blobReferenceForConsumption = BlobReferenceForConsumption.DeserializeBlobReferenceForConsumption(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AssetCredentialResponse(blobReferenceForConsumption, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AssetCredentialResponse)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AssetCredentialResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAssetCredentialResponse(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AssetCredentialResponse)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static AssetCredentialResponse FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAssetCredentialResponse(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.cs
new file mode 100644
index 000000000000..5a0abe5ddc4b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AssetCredentialResponse.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Represents a reference to a blob for consumption.
+ public partial class AssetCredentialResponse
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// Credential info to access the storage account.
+ /// is null.
+ internal AssetCredentialResponse(BlobReferenceForConsumption blobReferenceForConsumption)
+ {
+ Argument.AssertNotNull(blobReferenceForConsumption, nameof(blobReferenceForConsumption));
+
+ BlobReferenceForConsumption = blobReferenceForConsumption;
+ }
+
+ /// Initializes a new instance of .
+ /// Credential info to access the storage account.
+ /// Keeps track of any properties unknown to the library.
+ internal AssetCredentialResponse(BlobReferenceForConsumption blobReferenceForConsumption, IDictionary serializedAdditionalRawData)
+ {
+ BlobReferenceForConsumption = blobReferenceForConsumption;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AssetCredentialResponse()
+ {
+ }
+
+ /// Credential info to access the storage account.
+ public BlobReferenceForConsumption BlobReferenceForConsumption { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AttackStrategy.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AttackStrategy.cs
new file mode 100644
index 000000000000..8c8072533d45
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AttackStrategy.cs
@@ -0,0 +1,117 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Strategies for attacks.
+ public readonly partial struct AttackStrategy : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AttackStrategy(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string EasyValue = "easy";
+ private const string ModerateValue = "moderate";
+ private const string DifficultValue = "difficult";
+ private const string AsciiArtValue = "ascii_art";
+ private const string AsciiSmugglerValue = "ascii_smuggler";
+ private const string AtbashValue = "atbash";
+ private const string Base64Value = "base64";
+ private const string BinaryValue = "binary";
+ private const string CaesarValue = "caesar";
+ private const string CharacterSpaceValue = "character_space";
+ private const string JailbreakValue = "jailbreak";
+ private const string AnsiiAttackValue = "ansii_attack";
+ private const string CharacterSwapValue = "character_swap";
+ private const string SuffixAppendValue = "suffix_append";
+ private const string StringJoinValue = "string_join";
+ private const string UnicodeConfusableValue = "unicode_confusable";
+ private const string UnicodeSubstitutionValue = "unicode_substitution";
+ private const string DiacriticValue = "diacritic";
+ private const string FlipValue = "flip";
+ private const string LeetspeakValue = "leetspeak";
+ private const string ROT13Value = "rot13";
+ private const string MorseValue = "morse";
+ private const string UrlValue = "url";
+ private const string BaselineValue = "baseline";
+
+ /// Represents a default set of easy complexity attacks. Easy complexity attacks require less effort, such as translation of a prompt into some encoding, and does not require any Large Language Model to convert or orchestrate.
+ public static AttackStrategy Easy { get; } = new AttackStrategy(EasyValue);
+ /// Represents a default set of moderate complexity attacks. Moderate complexity attacks require having access to resources such as another generative AI model.
+ public static AttackStrategy Moderate { get; } = new AttackStrategy(ModerateValue);
+ /// Represents a default set of difficult complexity attacks. Difficult complexity attacks include attacks that require access to significant resources and effort to execute an attack such as knowledge of search-based algorithms in addition to a generative AI model.
+ public static AttackStrategy Difficult { get; } = new AttackStrategy(DifficultValue);
+ /// Generates visual art using ASCII characters, often used for creative or obfuscation purposes.
+ public static AttackStrategy AsciiArt { get; } = new AttackStrategy(AsciiArtValue);
+ /// Conceals data within ASCII characters, making it harder to detect.
+ public static AttackStrategy AsciiSmuggler { get; } = new AttackStrategy(AsciiSmugglerValue);
+ /// Implements the Atbash cipher, a simple substitution cipher where each letter is mapped to its reverse.
+ public static AttackStrategy Atbash { get; } = new AttackStrategy(AtbashValue);
+ /// Encodes binary data into a text format using Base64, commonly used for data transmission.
+ public static AttackStrategy Base64 { get; } = new AttackStrategy(Base64Value);
+ /// Converts text into binary code, representing data in a series of 0s and 1s.
+ public static AttackStrategy Binary { get; } = new AttackStrategy(BinaryValue);
+ /// Applies the Caesar cipher, a substitution cipher that shifts characters by a fixed number of positions.
+ public static AttackStrategy Caesar { get; } = new AttackStrategy(CaesarValue);
+ /// Alters text by adding spaces between characters, often used for obfuscation.
+ public static AttackStrategy CharacterSpace { get; } = new AttackStrategy(CharacterSpaceValue);
+ /// Injects specially crafted prompts to bypass AI safeguards, known as User Injected Prompt Attacks (UPIA).
+ public static AttackStrategy Jailbreak { get; } = new AttackStrategy(JailbreakValue);
+ /// Utilizes ANSI escape sequences to manipulate text appearance and behavior.
+ public static AttackStrategy AnsiiAttack { get; } = new AttackStrategy(AnsiiAttackValue);
+ /// Swaps characters within text to create variations or obfuscate the original content.
+ public static AttackStrategy CharacterSwap { get; } = new AttackStrategy(CharacterSwapValue);
+ /// Appends an adversarial suffix to the prompt.
+ public static AttackStrategy SuffixAppend { get; } = new AttackStrategy(SuffixAppendValue);
+ /// Joins multiple strings together, often used for concatenation or obfuscation.
+ public static AttackStrategy StringJoin { get; } = new AttackStrategy(StringJoinValue);
+ /// Uses Unicode characters that look similar to standard characters, creating visual confusion.
+ public static AttackStrategy UnicodeConfusable { get; } = new AttackStrategy(UnicodeConfusableValue);
+ /// Substitutes standard characters with Unicode equivalents, often for obfuscation.
+ public static AttackStrategy UnicodeSubstitution { get; } = new AttackStrategy(UnicodeSubstitutionValue);
+ /// Adds diacritical marks to characters, changing their appearance and sometimes their meaning.
+ public static AttackStrategy Diacritic { get; } = new AttackStrategy(DiacriticValue);
+ /// Flips characters from front to back, creating a mirrored effect.
+ public static AttackStrategy Flip { get; } = new AttackStrategy(FlipValue);
+ /// Transforms text into Leetspeak, a form of encoding that replaces letters with similar-looking numbers or symbols.
+ public static AttackStrategy Leetspeak { get; } = new AttackStrategy(LeetspeakValue);
+ /// Applies the ROT13 cipher, a simple substitution cipher that shifts characters by 13 positions.
+ public static AttackStrategy ROT13 { get; } = new AttackStrategy(ROT13Value);
+ /// Encodes text into Morse code, using dots and dashes to represent characters.
+ public static AttackStrategy Morse { get; } = new AttackStrategy(MorseValue);
+ /// Encodes text into URL format.
+ public static AttackStrategy Url { get; } = new AttackStrategy(UrlValue);
+ /// Represents the baseline direct adversarial probing, which is used by attack strategies as the attack objective.
+ public static AttackStrategy Baseline { get; } = new AttackStrategy(BaselineValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AttackStrategy left, AttackStrategy right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AttackStrategy left, AttackStrategy right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator AttackStrategy(string value) => new AttackStrategy(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AttackStrategy other && Equals(other);
+ ///
+ public bool Equals(AttackStrategy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.Serialization.cs
new file mode 100644
index 000000000000..32b697535785
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.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.OneDP
+{
+ public partial class AzureAISearchIndex : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureAISearchIndex)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("connectionName"u8);
+ writer.WriteStringValue(ConnectionName);
+ writer.WritePropertyName("indexName"u8);
+ writer.WriteStringValue(IndexName);
+ }
+
+ AzureAISearchIndex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AzureAISearchIndex)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAzureAISearchIndex(document.RootElement, options);
+ }
+
+ internal static AzureAISearchIndex DeserializeAzureAISearchIndex(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string connectionName = default;
+ string indexName = default;
+ IndexType type = 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("connectionName"u8))
+ {
+ connectionName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("indexName"u8))
+ {
+ indexName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new 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 AzureAISearchIndex(
+ type,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags ?? new ChangeTrackingDictionary(),
+ serializedAdditionalRawData,
+ connectionName,
+ indexName);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(AzureAISearchIndex)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AzureAISearchIndex IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAzureAISearchIndex(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AzureAISearchIndex)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new AzureAISearchIndex FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAzureAISearchIndex(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.cs
new file mode 100644
index 000000000000..f386432d38b9
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/AzureAISearchIndex.cs
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Azure AI Search Index Definition.
+ public partial class AzureAISearchIndex : Index
+ {
+ /// Initializes a new instance of .
+ /// Name of connection to Azure AI Search.
+ /// Name of index in Azure AI Search resource to attach.
+ /// or is null.
+ public AzureAISearchIndex(string connectionName, string indexName)
+ {
+ Argument.AssertNotNull(connectionName, nameof(connectionName));
+ Argument.AssertNotNull(indexName, nameof(indexName));
+
+ Type = IndexType.AzureSearch;
+ ConnectionName = connectionName;
+ IndexName = indexName;
+ }
+
+ /// 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.
+ /// Name of connection to Azure AI Search.
+ /// Name of index in Azure AI Search resource to attach.
+ internal AzureAISearchIndex(IndexType type, string stage, string id, string name, string version, string description, IDictionary tags, IDictionary serializedAdditionalRawData, string connectionName, string indexName) : base(type, stage, id, name, version, description, tags, serializedAdditionalRawData)
+ {
+ ConnectionName = connectionName;
+ IndexName = indexName;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal AzureAISearchIndex()
+ {
+ }
+
+ /// Name of connection to Azure AI Search.
+ public string ConnectionName { get; set; }
+ /// Name of index in Azure AI Search resource to attach.
+ public string IndexName { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.Serialization.cs
new file mode 100644
index 000000000000..4e302bf54def
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.Serialization.cs
@@ -0,0 +1,137 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownBaseCredentials))]
+ public partial class BaseCredentials : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BaseCredentials)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("authType"u8);
+ writer.WriteStringValue(AuthType.ToString());
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ BaseCredentials IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BaseCredentials)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBaseCredentials(document.RootElement, options);
+ }
+
+ internal static BaseCredentials DeserializeBaseCredentials(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("authType", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "AAD": return EntraIDCredentials.DeserializeEntraIDCredentials(element, options);
+ case "ApiKey": return ApiKeyCredentials.DeserializeApiKeyCredentials(element, options);
+ case "CustomKeys": return CustomCredential.DeserializeCustomCredential(element, options);
+ case "None": return NoAuthenticationCredentials.DeserializeNoAuthenticationCredentials(element, options);
+ case "SAS": return SASCredentials.DeserializeSASCredentials(element, options);
+ }
+ }
+ return UnknownBaseCredentials.DeserializeUnknownBaseCredentials(element, options);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BaseCredentials)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BaseCredentials IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBaseCredentials(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BaseCredentials)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static BaseCredentials FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBaseCredentials(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.cs
new file mode 100644
index 000000000000..49e30bc72ce0
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BaseCredentials.cs
@@ -0,0 +1,69 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// A base class for connection credentials
+ /// 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 .
+ ///
+ public abstract partial class BaseCredentials
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected BaseCredentials()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The type of credential used by the connection.
+ /// Keeps track of any properties unknown to the library.
+ internal BaseCredentials(CredentialType authType, IDictionary serializedAdditionalRawData)
+ {
+ AuthType = authType;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The type of credential used by the connection.
+ internal CredentialType AuthType { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.Serialization.cs
new file mode 100644
index 000000000000..eedd81b445eb
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.Serialization.cs
@@ -0,0 +1,158 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ public partial class BlobReferenceForConsumption : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BlobReferenceForConsumption)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("blobUri"u8);
+ writer.WriteStringValue(BlobUri);
+ writer.WritePropertyName("storageAccountArmId"u8);
+ writer.WriteStringValue(StorageAccountArmId);
+ writer.WritePropertyName("credential"u8);
+ writer.WriteObjectValue(Credential, options);
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ BlobReferenceForConsumption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(BlobReferenceForConsumption)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeBlobReferenceForConsumption(document.RootElement, options);
+ }
+
+ internal static BlobReferenceForConsumption DeserializeBlobReferenceForConsumption(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string blobUri = default;
+ string storageAccountArmId = default;
+ SasCredential credential = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("blobUri"u8))
+ {
+ blobUri = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("storageAccountArmId"u8))
+ {
+ storageAccountArmId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("credential"u8))
+ {
+ credential = SasCredential.DeserializeSasCredential(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new BlobReferenceForConsumption(blobUri, storageAccountArmId, credential, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(BlobReferenceForConsumption)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ BlobReferenceForConsumption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBlobReferenceForConsumption(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(BlobReferenceForConsumption)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static BlobReferenceForConsumption FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeBlobReferenceForConsumption(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.cs
new file mode 100644
index 000000000000..92c798d2b25a
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/BlobReferenceForConsumption.cs
@@ -0,0 +1,89 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Represents a reference to a blob for consumption.
+ public partial class BlobReferenceForConsumption
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// 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.
+ /// , or is null.
+ internal BlobReferenceForConsumption(string blobUri, string storageAccountArmId, SasCredential credential)
+ {
+ Argument.AssertNotNull(blobUri, nameof(blobUri));
+ Argument.AssertNotNull(storageAccountArmId, nameof(storageAccountArmId));
+ Argument.AssertNotNull(credential, nameof(credential));
+
+ BlobUri = blobUri;
+ StorageAccountArmId = storageAccountArmId;
+ Credential = credential;
+ }
+
+ /// 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.
+ /// Keeps track of any properties unknown to the library.
+ internal BlobReferenceForConsumption(string blobUri, string storageAccountArmId, SasCredential credential, IDictionary serializedAdditionalRawData)
+ {
+ BlobUri = blobUri;
+ StorageAccountArmId = storageAccountArmId;
+ Credential = credential;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal BlobReferenceForConsumption()
+ {
+ }
+
+ /// Blob URI path for client to upload data. Example: https://blob.windows.core.net/Container/Path.
+ public string BlobUri { get; }
+ /// ARM ID of the storage account to use.
+ public string StorageAccountArmId { get; }
+ /// Credential info to access the storage account.
+ public SasCredential Credential { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.Serialization.cs
new file mode 100644
index 000000000000..3cd9ef6f108f
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.Serialization.cs
@@ -0,0 +1,162 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownConnection))]
+ public partial class Connection : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(Connection)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("authType"u8);
+ writer.WriteStringValue(AuthType);
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("target"u8);
+ writer.WriteStringValue(Target);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("isDefault"u8);
+ writer.WriteBooleanValue(IsDefault);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("credentials"u8);
+ writer.WriteObjectValue(Credentials, options);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("metadata"u8);
+ writer.WriteStartObject();
+ foreach (var item in Metadata)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ Connection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(Connection)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeConnection(document.RootElement, options);
+ }
+
+ internal static Connection DeserializeConnection(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ return UnknownConnection.DeserializeUnknownConnection(element, options);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(Connection)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Connection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConnection(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Connection)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static Connection FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeConnection(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.cs
new file mode 100644
index 000000000000..7b117e3e30ea
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connection.cs
@@ -0,0 +1,98 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Response from the list and get connections operations.
+ public abstract partial class Connection
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected Connection()
+ {
+ Metadata = new ChangeTrackingDictionary();
+ }
+
+ /// 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 Connection(string authType, string name, ConnectionType type, string target, bool isDefault, BaseCredentials credentials, IReadOnlyDictionary metadata, IDictionary serializedAdditionalRawData)
+ {
+ AuthType = authType;
+ Name = name;
+ Type = type;
+ Target = target;
+ IsDefault = isDefault;
+ Credentials = credentials;
+ Metadata = metadata;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Discriminator property for Connection.
+ internal string AuthType { get; set; }
+ /// The name of the resource.
+ public string Name { get; }
+ /// Category of the connection.
+ public ConnectionType Type { get; }
+ /// The connection URL to be used for this service.
+ public string Target { get; }
+ /// Whether the connection is tagged as the default connection of its type.
+ public bool IsDefault { get; }
+ ///
+ /// 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 .
+ ///
+ public BaseCredentials Credentials { get; }
+ /// Metadata of the connection.
+ public IReadOnlyDictionary Metadata { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ConnectionType.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ConnectionType.cs
new file mode 100644
index 000000000000..375362702d4a
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/ConnectionType.cs
@@ -0,0 +1,72 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// The Type (or category) of the connection.
+ public readonly partial struct ConnectionType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ConnectionType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string AzureOpenAIValue = "AzureOpenAI";
+ private const string AzureBlobStorageValue = "AzureBlob";
+ private const string AzureStorageAccountValue = "AzureStorageAccount";
+ private const string AzureAISearchValue = "CognitiveSearch";
+ private const string CosmosDBValue = "CosmosDB";
+ private const string APIKeyValue = "ApiKey";
+ private const string ApplicationConfigurationValue = "AppConfig";
+ private const string ApplicationInsightsValue = "AppInsights";
+ private const string CustomValue = "CustomKeys";
+
+ /// Azure OpenAI Service.
+ public static ConnectionType AzureOpenAI { get; } = new ConnectionType(AzureOpenAIValue);
+ /// Azure Blob Storage, with specified container.
+ public static ConnectionType AzureBlobStorage { get; } = new ConnectionType(AzureBlobStorageValue);
+ /// Azure Blob Storage, with container not specified (used by Assistants).
+ public static ConnectionType AzureStorageAccount { get; } = new ConnectionType(AzureStorageAccountValue);
+ /// Azure AI Search.
+ public static ConnectionType AzureAISearch { get; } = new ConnectionType(AzureAISearchValue);
+ /// CosmosDB.
+ public static ConnectionType CosmosDB { get; } = new ConnectionType(CosmosDBValue);
+ /// Generic connection that uses API Key authentication.
+ public static ConnectionType APIKey { get; } = new ConnectionType(APIKeyValue);
+ /// Application Configuration.
+ public static ConnectionType ApplicationConfiguration { get; } = new ConnectionType(ApplicationConfigurationValue);
+ /// Application Insights.
+ public static ConnectionType ApplicationInsights { get; } = new ConnectionType(ApplicationInsightsValue);
+ /// Custom Keys.
+ public static ConnectionType Custom { get; } = new ConnectionType(CustomValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ConnectionType left, ConnectionType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ConnectionType left, ConnectionType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator ConnectionType(string value) => new ConnectionType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ConnectionType other && Equals(other);
+ ///
+ public bool Equals(ConnectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connections.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connections.cs
new file mode 100644
index 000000000000..83c023b071d7
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Connections.cs
@@ -0,0 +1,594 @@
+// 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.OneDP
+{
+ // Data plane generated sub-client.
+ /// The Connections sub-client.
+ public partial class Connections
+ {
+ 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;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of Connections for mocking.
+ protected Connections()
+ {
+ }
+
+ /// Initializes a new instance of Connections.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The key credential to copy.
+ /// The token credential to copy.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// The API version to use for this operation.
+ internal Connections(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _keyCredential = keyCredential;
+ _tokenCredential = tokenCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Get a connection by name, without populating connection credentials.
+ /// The name of the resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetConnectionAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetConnectionAsync(name, context).ConfigureAwait(false);
+ return Response.FromValue(Connection.FromResponse(response), response);
+ }
+
+ /// Get a connection by name, without populating connection credentials.
+ /// The name of the resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response GetConnection(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetConnection(name, context);
+ return Response.FromValue(Connection.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Get a connection by name, 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.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task GetConnectionAsync(string name, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = ClientDiagnostics.CreateScope("Connections.GetConnection");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetConnectionRequest(name, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Get a connection by name, 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.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response GetConnection(string name, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = ClientDiagnostics.CreateScope("Connections.GetConnection");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetConnectionRequest(name, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get a connection by name, with its connection credentials.
+ /// The name of the resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetWithCredentialsAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetWithCredentialsAsync(name, context).ConfigureAwait(false);
+ return Response.FromValue(Connection.FromResponse(response), response);
+ }
+
+ /// Get a connection by name, with its connection credentials.
+ /// The name of the resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual Response GetWithCredentials(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetWithCredentials(name, context);
+ return Response.FromValue(Connection.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Get a connection by name, with its 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.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task GetWithCredentialsAsync(string name, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = ClientDiagnostics.CreateScope("Connections.GetWithCredentials");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetWithCredentialsRequest(name, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Get a connection by name, with its 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.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response GetWithCredentials(string name, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ using var scope = ClientDiagnostics.CreateScope("Connections.GetWithCredentials");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetWithCredentialsRequest(name, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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 AsyncPageable GetConnectionsAsync(ConnectionType? connectionType = null, bool? defaultConnection = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, 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.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Connection.DeserializeConnection(e), ClientDiagnostics, _pipeline, "Connections.GetConnections", "value", "nextLink", maxpagesize, context);
+ }
+
+ /// 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 Pageable GetConnections(ConnectionType? connectionType = null, bool? defaultConnection = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, 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 => 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 AsyncPageable GetConnectionsAsync(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, 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 Pageable GetConnections(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, 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);
+ }
+
+ /// List all connections in the project, with their 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 AsyncPageable GetWithCredentialsAsync(ConnectionType? connectionType = null, bool? defaultConnection = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null;
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWithCredentialsRequest(connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWithCredentialsNextPageRequest(nextLink, connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => Connection.DeserializeConnection(e), ClientDiagnostics, _pipeline, "Connections.GetWithCredentials", "value", "nextLink", maxpagesize, context);
+ }
+
+ /// List all connections in the project, with their 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 Pageable GetWithCredentials(ConnectionType? connectionType = null, bool? defaultConnection = null, int? maxCount = null, int? skip = null, int? maxpagesize = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new RequestContext { CancellationToken = cancellationToken } : null;
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWithCredentialsRequest(connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWithCredentialsNextPageRequest(nextLink, connectionType?.ToString(), defaultConnection, maxCount, skip, pageSizeHint, context);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => Connection.DeserializeConnection(e), ClientDiagnostics, _pipeline, "Connections.GetWithCredentials", "value", "nextLink", maxpagesize, context);
+ }
+
+ ///
+ /// [Protocol Method] List all connections in the project, with their 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 AsyncPageable GetWithCredentialsAsync(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, RequestContext context)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWithCredentialsRequest(connectionType, defaultConnection, maxCount, skip, pageSizeHint, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWithCredentialsNextPageRequest(nextLink, connectionType, defaultConnection, maxCount, skip, pageSizeHint, context);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Connections.GetWithCredentials", "value", "nextLink", maxpagesize, context);
+ }
+
+ ///
+ /// [Protocol Method] List all connections in the project, with their 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 Pageable GetWithCredentials(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, RequestContext context)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => CreateGetWithCredentialsRequest(connectionType, defaultConnection, maxCount, skip, pageSizeHint, context);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CreateGetWithCredentialsNextPageRequest(nextLink, connectionType, defaultConnection, maxCount, skip, pageSizeHint, context);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => BinaryData.FromString(e.GetRawText()), ClientDiagnostics, _pipeline, "Connections.GetWithCredentials", "value", "nextLink", maxpagesize, context);
+ }
+
+ internal HttpMessage CreateGetConnectionRequest(string name, 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, 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("/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, 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 CreateGetWithCredentialsRequest(string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, 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("/connections/withCredentials", 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, 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 CreateGetWithCredentialsNextPageRequest(string nextLink, string connectionType, bool? defaultConnection, int? maxCount, int? skip, int? maxpagesize, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200);
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ private static RequestContext DefaultRequestContext = new RequestContext();
+ internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default)
+ {
+ if (!cancellationToken.CanBeCanceled)
+ {
+ return DefaultRequestContext;
+ }
+
+ return new RequestContext() { CancellationToken = cancellationToken };
+ }
+
+ private static ResponseClassifier _responseClassifier200;
+ private static ResponseClassifier ResponseClassifier200 => _responseClassifier200 ??= new StatusCodeClassifier(stackalloc ushort[] { 200 });
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.Serialization.cs
new file mode 100644
index 000000000000..d1e12fc4bb57
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.Serialization.cs
@@ -0,0 +1,215 @@
+// 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.OneDP
+{
+ public partial class CosmosDBIndex : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CosmosDBIndex)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ writer.WritePropertyName("connectionName"u8);
+ writer.WriteStringValue(ConnectionName);
+ writer.WritePropertyName("databaseName"u8);
+ writer.WriteStringValue(DatabaseName);
+ writer.WritePropertyName("containerName"u8);
+ writer.WriteStringValue(ContainerName);
+ writer.WritePropertyName("embeddingConfiguration"u8);
+ writer.WriteObjectValue(EmbeddingConfiguration, options);
+ }
+
+ CosmosDBIndex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CosmosDBIndex)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCosmosDBIndex(document.RootElement, options);
+ }
+
+ internal static CosmosDBIndex DeserializeCosmosDBIndex(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string connectionName = default;
+ string databaseName = default;
+ string containerName = default;
+ EmbeddingConfiguration embeddingConfiguration = default;
+ IndexType type = 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("connectionName"u8))
+ {
+ connectionName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("databaseName"u8))
+ {
+ databaseName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("containerName"u8))
+ {
+ containerName = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("embeddingConfiguration"u8))
+ {
+ embeddingConfiguration = EmbeddingConfiguration.DeserializeEmbeddingConfiguration(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("type"u8))
+ {
+ type = new 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 CosmosDBIndex(
+ type,
+ stage,
+ id,
+ name,
+ version,
+ description,
+ tags ?? new ChangeTrackingDictionary(),
+ serializedAdditionalRawData,
+ connectionName,
+ databaseName,
+ containerName,
+ embeddingConfiguration);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(CosmosDBIndex)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CosmosDBIndex IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCosmosDBIndex(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CosmosDBIndex)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new CosmosDBIndex FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCosmosDBIndex(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.cs
new file mode 100644
index 000000000000..85649157ac70
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CosmosDBIndex.cs
@@ -0,0 +1,71 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// CosmosDB Vector Store Index Definition.
+ public partial class CosmosDBIndex : Index
+ {
+ /// Initializes a new instance of .
+ /// Name of connection to CosmosDB.
+ /// Name of the CosmosDB Database.
+ /// Name of CosmosDB Container.
+ /// Embedding model configuration.
+ /// , , or is null.
+ public CosmosDBIndex(string connectionName, string databaseName, string containerName, EmbeddingConfiguration embeddingConfiguration)
+ {
+ Argument.AssertNotNull(connectionName, nameof(connectionName));
+ Argument.AssertNotNull(databaseName, nameof(databaseName));
+ Argument.AssertNotNull(containerName, nameof(containerName));
+ Argument.AssertNotNull(embeddingConfiguration, nameof(embeddingConfiguration));
+
+ Type = IndexType.CosmosDB;
+ ConnectionName = connectionName;
+ DatabaseName = databaseName;
+ ContainerName = containerName;
+ EmbeddingConfiguration = embeddingConfiguration;
+ }
+
+ /// 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.
+ /// Name of connection to CosmosDB.
+ /// Name of the CosmosDB Database.
+ /// Name of CosmosDB Container.
+ /// Embedding model configuration.
+ internal CosmosDBIndex(IndexType type, string stage, string id, string name, string version, string description, IDictionary tags, IDictionary serializedAdditionalRawData, string connectionName, string databaseName, string containerName, EmbeddingConfiguration embeddingConfiguration) : base(type, stage, id, name, version, description, tags, serializedAdditionalRawData)
+ {
+ ConnectionName = connectionName;
+ DatabaseName = databaseName;
+ ContainerName = containerName;
+ EmbeddingConfiguration = embeddingConfiguration;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal CosmosDBIndex()
+ {
+ }
+
+ /// Name of connection to CosmosDB.
+ public string ConnectionName { get; set; }
+ /// Name of the CosmosDB Database.
+ public string DatabaseName { get; set; }
+ /// Name of CosmosDB Container.
+ public string ContainerName { get; set; }
+ /// Embedding model configuration.
+ public EmbeddingConfiguration EmbeddingConfiguration { get; set; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CredentialType.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CredentialType.cs
new file mode 100644
index 000000000000..514a83343de4
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CredentialType.cs
@@ -0,0 +1,60 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// The credential type used by the connection.
+ internal readonly partial struct CredentialType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public CredentialType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ApiKeyValue = "ApiKey";
+ private const string EntraIdValue = "AAD";
+ private const string SASValue = "SAS";
+ private const string CustomValue = "CustomKeys";
+ private const string NoneValue = "None";
+
+ /// API Key credential.
+ public static CredentialType ApiKey { get; } = new CredentialType(ApiKeyValue);
+ /// Entra ID credential (formerly known as AAD).
+ public static CredentialType EntraId { get; } = new CredentialType(EntraIdValue);
+ /// Shared Access Signature (SAS) credential.
+ public static CredentialType SAS { get; } = new CredentialType(SASValue);
+ /// Custom credential.
+ public static CredentialType Custom { get; } = new CredentialType(CustomValue);
+ /// No credential.
+ public static CredentialType None { get; } = new CredentialType(NoneValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(CredentialType left, CredentialType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(CredentialType left, CredentialType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator CredentialType(string value) => new CredentialType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is CredentialType other && Equals(other);
+ ///
+ public bool Equals(CredentialType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.Serialization.cs
new file mode 100644
index 000000000000..bf480262d9a1
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.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.OneDP
+{
+ public partial class CustomCredential : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CustomCredential)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ }
+
+ CustomCredential IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(CustomCredential)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCustomCredential(document.RootElement, options);
+ }
+
+ internal static CustomCredential DeserializeCustomCredential(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ CredentialType authType = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("authType"u8))
+ {
+ authType = new CredentialType(property.Value.GetString());
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new CustomCredential(authType, serializedAdditionalRawData);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(CustomCredential)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CustomCredential IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCustomCredential(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CustomCredential)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static new CustomCredential FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCustomCredential(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal override RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.cs
new file mode 100644
index 000000000000..c2348eac4371
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/CustomCredential.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.OneDP
+{
+ /// Custom credential defintion.
+ public partial class CustomCredential : BaseCredentials
+ {
+ /// Initializes a new instance of .
+ internal CustomCredential()
+ {
+ AuthType = CredentialType.Custom;
+ }
+
+ /// Initializes a new instance of .
+ /// The type of credential used by the connection.
+ /// Keeps track of any properties unknown to the library.
+ internal CustomCredential(CredentialType authType, IDictionary serializedAdditionalRawData) : base(authType, serializedAdditionalRawData)
+ {
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetType.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetType.cs
new file mode 100644
index 000000000000..4be625d96a85
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetType.cs
@@ -0,0 +1,51 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// Enum to determine the type of data.
+ internal readonly partial struct DatasetType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DatasetType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string UriFileValue = "uri_file";
+ private const string UriFolderValue = "uri_folder";
+
+ /// URI file.
+ public static DatasetType UriFile { get; } = new DatasetType(UriFileValue);
+ /// URI folder.
+ public static DatasetType UriFolder { get; } = new DatasetType(UriFolderValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DatasetType left, DatasetType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DatasetType left, DatasetType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator DatasetType(string value) => new DatasetType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DatasetType other && Equals(other);
+ ///
+ public bool Equals(DatasetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.Serialization.cs
new file mode 100644
index 000000000000..16279d2cddce
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.Serialization.cs
@@ -0,0 +1,177 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownDatasetVersion))]
+ public partial class DatasetVersion : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DatasetVersion)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("datasetUri"u8);
+ writer.WriteStringValue(DatasetUri);
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ if (options.Format != "W" && Optional.IsDefined(IsReference))
+ {
+ writer.WritePropertyName("isReference"u8);
+ writer.WriteBooleanValue(IsReference.Value);
+ }
+ if (Optional.IsDefined(Stage))
+ {
+ writer.WritePropertyName("stage"u8);
+ writer.WriteStringValue(Stage);
+ }
+ if (options.Format != "W" && Optional.IsDefined(Id))
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteStringValue(Id);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("version"u8);
+ writer.WriteStringValue(Version);
+ }
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ if (Optional.IsCollectionDefined(Tags))
+ {
+ writer.WritePropertyName("tags"u8);
+ writer.WriteStartObject();
+ foreach (var item in Tags)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ DatasetVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DatasetVersion)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDatasetVersion(document.RootElement, options);
+ }
+
+ internal static DatasetVersion DeserializeDatasetVersion(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "uri_file": return FileDatasetVersion.DeserializeFileDatasetVersion(element, options);
+ case "uri_folder": return FolderDatasetVersion.DeserializeFolderDatasetVersion(element, options);
+ }
+ }
+ return UnknownDatasetVersion.DeserializeUnknownDatasetVersion(element, options);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(DatasetVersion)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DatasetVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDatasetVersion(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DatasetVersion)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static DatasetVersion FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDatasetVersion(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.cs
new file mode 100644
index 000000000000..cefd86f144b6
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DatasetVersion.cs
@@ -0,0 +1,112 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// DatasetVersion Definition
+ /// 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 .
+ ///
+ public abstract partial class DatasetVersion
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ /// is null.
+ protected DatasetVersion(string datasetUri)
+ {
+ Argument.AssertNotNull(datasetUri, nameof(datasetUri));
+
+ DatasetUri = datasetUri;
+ Tags = new ChangeTrackingDictionary();
+ }
+
+ /// 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 DatasetVersion(string datasetUri, DatasetType type, bool? isReference, string stage, string id, string name, string version, string description, IDictionary tags, IDictionary serializedAdditionalRawData)
+ {
+ DatasetUri = datasetUri;
+ Type = type;
+ IsReference = isReference;
+ Stage = stage;
+ Id = id;
+ Name = name;
+ Version = version;
+ Description = description;
+ Tags = tags;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal DatasetVersion()
+ {
+ }
+
+ /// [Required] Uri of the data. Example: https://go.microsoft.com/fwlink/?linkid=2202330.
+ public string DatasetUri { get; set; }
+ /// Dataset type.
+ internal DatasetType Type { get; set; }
+ /// 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.
+ public bool? IsReference { get; }
+ /// Asset stage.
+ public string Stage { get; set; }
+ /// A unique identifier for the asset, assetId probably?.
+ public string Id { get; }
+ /// The name of the resource.
+ public string Name { get; }
+ /// The version of the resource.
+ public string Version { get; }
+ /// The asset description text.
+ public string Description { get; set; }
+ /// Tag dictionary. Tags can be added, removed, and updated.
+ public IDictionary Tags { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Datasets.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Datasets.cs
new file mode 100644
index 000000000000..117e10a7e5e8
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Datasets.cs
@@ -0,0 +1,1109 @@
+// 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.OneDP
+{
+ // Data plane generated sub-client.
+ /// The Datasets sub-client.
+ public partial class Datasets
+ {
+ 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;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of Datasets for mocking.
+ protected Datasets()
+ {
+ }
+
+ /// Initializes a new instance of Datasets.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The key credential to copy.
+ /// The token credential to copy.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// The API version to use for this operation.
+ internal Datasets(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _keyCredential = keyCredential;
+ _tokenCredential = tokenCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Get the specific version of the DatasetVersion.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to retrieve.
+ /// The cancellation token to use.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetVersionAsync(string name, string version, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetVersionAsync(name, version, context).ConfigureAwait(false);
+ return Response.FromValue(DatasetVersion.FromResponse(response), response);
+ }
+
+ /// Get the specific version of the DatasetVersion.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to retrieve.
+ /// The cancellation token to use.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual Response GetVersion(string name, string version, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetVersion(name, version, context);
+ return Response.FromValue(DatasetVersion.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Get the specific version of the 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.
+ /// The specific version id of the DatasetVersion to retrieve.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task GetVersionAsync(string name, string version, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.GetVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetVersionRequest(name, version, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Get the specific version of the 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.
+ /// The specific version id of the DatasetVersion to retrieve.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response GetVersion(string name, string version, RequestContext context)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.GetVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetVersionRequest(name, version, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Delete the specific version of the DatasetVersion
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The version of the DatasetVersion to delete.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task DeleteVersionAsync(string name, string version, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.DeleteVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteVersionRequest(name, version, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ // The convenience method is omitted here because it has exactly the same parameter list as the corresponding protocol method
+ ///
+ /// [Protocol Method] Delete the specific version of the DatasetVersion
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The version of the DatasetVersion to delete.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response DeleteVersion(string name, string version, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.DeleteVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateDeleteVersionRequest(name, version, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Create a new or replace an existing DatasetVersion with the given version id.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The definition of the DatasetVersion to create.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual async Task> CreateVersionAsync(string name, string version, DatasetVersion body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await CreateVersionAsync(name, version, content, context).ConfigureAwait(false);
+ return Response.FromValue(DatasetVersion.FromResponse(response), response);
+ }
+
+ /// Create a new or replace an existing DatasetVersion with the given version id.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The definition of the DatasetVersion to create.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual Response CreateVersion(string name, string version, DatasetVersion body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = CreateVersion(name, version, content, context);
+ return Response.FromValue(DatasetVersion.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Create a new or replace an existing DatasetVersion with the given version id
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task CreateVersionAsync(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.CreateVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateVersionRequest(name, version, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Create a new or replace an existing DatasetVersion with the given version id
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response CreateVersion(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.CreateVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateVersionRequest(name, version, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Create a new or update an existing DatasetVersion with the given version id
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task CreateOrUpdateVersionAsync(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.CreateOrUpdateVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateOrUpdateVersionRequest(name, version, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Create a new or update an existing DatasetVersion with the given version id
+ ///
+ /// -
+ ///
+ /// This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
+ ///
+ ///
+ ///
+ ///
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to create or replace.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response CreateOrUpdateVersion(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.CreateOrUpdateVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateCreateOrUpdateVersionRequest(name, version, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Start a new or get an existing pending upload of a dataset for a specific version.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// Parameters for the action.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual async Task> StartPendingUploadVersionAsync(string name, string version, PendingUploadRequest body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await StartPendingUploadVersionAsync(name, version, content, context).ConfigureAwait(false);
+ return Response.FromValue(PendingUploadResponse.FromResponse(response), response);
+ }
+
+ /// Start a new or get an existing pending upload of a dataset for a specific version.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// Parameters for the action.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual Response StartPendingUploadVersion(string name, string version, PendingUploadRequest body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = StartPendingUploadVersion(name, version, content, context);
+ return Response.FromValue(PendingUploadResponse.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Start a new or get an existing pending upload of a dataset for a specific version.
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task StartPendingUploadVersionAsync(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.StartPendingUploadVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateStartPendingUploadVersionRequest(name, version, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Start a new or get an existing pending upload of a dataset for a specific version.
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response StartPendingUploadVersion(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.StartPendingUploadVersion");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateStartPendingUploadVersionRequest(name, version, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// Get download sas for dataset version.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// Parameters for the action.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetCredentialsAsync(string name, string version, GetCredentialsRequest body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetCredentialsAsync(name, version, content, context).ConfigureAwait(false);
+ return Response.FromValue(AssetCredentialResponse.FromResponse(response), response);
+ }
+
+ /// Get download sas for dataset version.
+ /// The name of the resource.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// Parameters for the action.
+ /// The cancellation token to use.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ public virtual Response GetCredentials(string name, string version, GetCredentialsRequest body, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(body, nameof(body));
+
+ using RequestContent content = body.ToRequestContent();
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = GetCredentials(name, version, content, context);
+ return Response.FromValue(AssetCredentialResponse.FromResponse(response), response);
+ }
+
+ ///
+ /// [Protocol Method] Get download sas for dataset version.
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual async Task GetCredentialsAsync(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.GetCredentials");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetCredentialsRequest(name, version, content, context);
+ return await _pipeline.ProcessMessageAsync(message, context).ConfigureAwait(false);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// [Protocol Method] Get download sas for dataset version.
+ ///
+ /// -
+ ///
+ /// 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.
+ /// The specific version id of the DatasetVersion to operate on.
+ /// The content to send as the body of the request.
+ /// The request context, which can override default behaviors of the client pipeline on a per-call basis.
+ /// , or is null.
+ /// or is an empty string, and was expected to be non-empty.
+ /// Service returned a non-success status code.
+ /// The response returned from the service.
+ public virtual Response GetCredentials(string name, string version, RequestContent content, RequestContext context = null)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+ Argument.AssertNotNullOrEmpty(version, nameof(version));
+ Argument.AssertNotNull(content, nameof(content));
+
+ using var scope = ClientDiagnostics.CreateScope("Datasets.GetCredentials");
+ scope.Start();
+ try
+ {
+ using HttpMessage message = CreateGetCredentialsRequest(name, version, content, context);
+ return _pipeline.ProcessMessage(message, context);
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ /// 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 AsyncPageable GetVersionsAsync(string name, int? maxCount = null, string skip = null, string tags = null, ListViewType? listViewType = null, CancellationToken cancellationToken = default)
+ {
+ 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.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => DatasetVersion.DeserializeDatasetVersion(e), ClientDiagnostics, _pipeline, "Datasets.GetVersions", "value", "nextLink", context);
+ }
+
+ /// 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 Pageable GetVersions(string name, int? maxCount = null, string skip = null, string tags = null, ListViewType? listViewType = null, CancellationToken cancellationToken = default)
+ {
+ 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 => 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 AsyncPageable GetVersionsAsync(string name, int? maxCount, string skip, string tags, string listViewType, RequestContext context)
+ {
+ 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 Pageable GetVersions(string name, int? maxCount, string skip, string tags, string listViewType, RequestContext context)
+ {
+ 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 AsyncPageable GetLatestsAsync(int? maxCount = null, string skip = null, string tags = null, ListViewType? listViewType = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new 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 => 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 Pageable GetLatests(int? maxCount = null, string skip = null, string tags = null, ListViewType? listViewType = null, CancellationToken cancellationToken = default)
+ {
+ RequestContext context = cancellationToken.CanBeCanceled ? new 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 => 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 AsyncPageable GetLatestsAsync(int? maxCount, string skip, string tags, string listViewType, 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 Pageable GetLatests(int? maxCount, string skip, string tags, string listViewType, 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, 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, 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, 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, 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, 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 CreateCreateOrUpdateVersionRequest(string name, string version, RequestContent content, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200201);
+ var request = message.Request;
+ request.Method = RequestMethod.Patch;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendPath("/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, 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, 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, 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, RequestContext context)
+ {
+ var message = _pipeline.CreateMessage(context, ResponseClassifier200);
+ var request = message.Request;
+ request.Method = RequestMethod.Get;
+ var uri = new RawRequestUriBuilder();
+ uri.Reset(_endpoint);
+ uri.AppendRawNextLink(nextLink, false);
+ request.Uri = uri;
+ request.Headers.Add("Accept", "application/json");
+ return message;
+ }
+
+ private static RequestContext DefaultRequestContext = new RequestContext();
+ internal static RequestContext FromCancellationToken(CancellationToken cancellationToken = default)
+ {
+ if (!cancellationToken.CanBeCanceled)
+ {
+ return DefaultRequestContext;
+ }
+
+ return new RequestContext() { CancellationToken = cancellationToken };
+ }
+
+ private static ResponseClassifier _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.OneDP/src/Generated/Deployment.Serialization.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployment.Serialization.cs
new file mode 100644
index 000000000000..efbc294a3bd7
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployment.Serialization.cs
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Projects.OneDP
+{
+ [PersistableModelProxy(typeof(UnknownDeployment))]
+ public partial class Deployment : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(Deployment)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("type"u8);
+ writer.WriteStringValue(Type.ToString());
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("name"u8);
+ writer.WriteStringValue(Name);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ Deployment IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(Deployment)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDeployment(document.RootElement, options);
+ }
+
+ internal static Deployment DeserializeDeployment(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ if (element.TryGetProperty("type", out JsonElement discriminator))
+ {
+ switch (discriminator.GetString())
+ {
+ case "ModelDeployment": return ModelDeployment.DeserializeModelDeployment(element, options);
+ }
+ }
+ return UnknownDeployment.DeserializeUnknownDeployment(element, options);
+ }
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ return ModelReaderWriter.Write(this, options);
+ default:
+ throw new FormatException($"The model {nameof(Deployment)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Deployment IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+
+ switch (format)
+ {
+ case "J":
+ {
+ using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDeployment(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Deployment)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+
+ /// Deserializes the model from a raw response.
+ /// The response to deserialize the model from.
+ internal static Deployment FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDeployment(document.RootElement);
+ }
+
+ /// Convert into a .
+ internal virtual RequestContent ToRequestContent()
+ {
+ var content = new Utf8JsonRequestContent();
+ content.JsonWriter.WriteObjectValue(this, ModelSerializationExtensions.WireOptions);
+ return content;
+ }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployment.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployment.cs
new file mode 100644
index 000000000000..6f223fa8644d
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployment.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Projects.OneDP
+{
+ ///
+ /// Model Deployment Definition
+ /// 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 .
+ ///
+ public abstract partial class Deployment
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private protected IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ protected 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 Deployment(DeploymentType type, string name, IDictionary serializedAdditionalRawData)
+ {
+ Type = type;
+ Name = name;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The type of the deployment.
+ internal DeploymentType Type { get; set; }
+ /// Name of the deployment.
+ public string Name { get; }
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DeploymentType.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DeploymentType.cs
new file mode 100644
index 000000000000..175f083ba827
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/DeploymentType.cs
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ComponentModel;
+
+namespace Azure.AI.Projects.OneDP
+{
+ /// The DeploymentType.
+ internal readonly partial struct DeploymentType : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public DeploymentType(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string ModelDeploymentValue = "ModelDeployment";
+
+ /// Model deployment.
+ public static DeploymentType ModelDeployment { get; } = new DeploymentType(ModelDeploymentValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(DeploymentType left, DeploymentType right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(DeploymentType left, DeploymentType right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator DeploymentType(string value) => new DeploymentType(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is DeploymentType other && Equals(other);
+ ///
+ public bool Equals(DeploymentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;
+ ///
+ public override string ToString() => _value;
+ }
+}
diff --git a/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployments.cs b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployments.cs
new file mode 100644
index 000000000000..501f96a9fb6b
--- /dev/null
+++ b/sdk/ai/Azure.AI.Projects.OneDP/src/Generated/Deployments.cs
@@ -0,0 +1,335 @@
+// 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.OneDP
+{
+ // Data plane generated sub-client.
+ /// The Deployments sub-client.
+ public partial class Deployments
+ {
+ 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;
+ private readonly string _apiVersion;
+
+ /// The ClientDiagnostics is used to provide tracing support for the client library.
+ internal ClientDiagnostics ClientDiagnostics { get; }
+
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ public virtual HttpPipeline Pipeline => _pipeline;
+
+ /// Initializes a new instance of Deployments for mocking.
+ protected Deployments()
+ {
+ }
+
+ /// Initializes a new instance of Deployments.
+ /// The handler for diagnostic messaging in the client.
+ /// The HTTP pipeline for sending and receiving REST requests and responses.
+ /// The key credential to copy.
+ /// The token credential to copy.
+ ///
+ /// Project endpoint. In the form "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/_project"
+ /// if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form
+ /// "https://<your-ai-services-account-name>.services.ai.azure.com/api/projects/<your-project-name>" if you want to explicitly
+ /// specify the Foundry Project name.
+ ///
+ /// The API version to use for this operation.
+ internal Deployments(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, AzureKeyCredential keyCredential, TokenCredential tokenCredential, Uri endpoint, string apiVersion)
+ {
+ ClientDiagnostics = clientDiagnostics;
+ _pipeline = pipeline;
+ _keyCredential = keyCredential;
+ _tokenCredential = tokenCredential;
+ _endpoint = endpoint;
+ _apiVersion = apiVersion;
+ }
+
+ /// Get a deployed model.
+ /// Name of the deployment.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ public virtual async Task> GetDeploymentAsync(string name, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(name, nameof(name));
+
+ RequestContext context = FromCancellationToken(cancellationToken);
+ Response response = await GetDeploymentAsync(name, context).ConfigureAwait(false);
+ return Response.FromValue(Deployment.FromResponse(response), response);
+ }
+
+ /// Get a deployed model.
+ /// Name of the deployment.
+ /// The cancellation token to use.
+ ///