diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Azure.AI.Language.QuestionAnswering.Authoring.sln b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Azure.AI.Language.QuestionAnswering.Authoring.sln
new file mode 100644
index 000000000000..6ff8ce78eddb
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Azure.AI.Language.QuestionAnswering.Authoring.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.Core.TestFramework", "..\..\core\Azure.Core.TestFramework\src\Azure.Core.TestFramework.csproj", "{ECC730C1-4AEA-420C-916A-66B19B79E4DC}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.QuestionAnswering.Authoring", "src\Azure.AI.Language.QuestionAnswering.Authoring.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.AI.Language.QuestionAnswering.Authoring.Tests", "tests\Azure.AI.Language.QuestionAnswering.Authoring.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ECC730C1-4AEA-420C-916A-66B19B79E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/CHANGELOG.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Directory.Build.props b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/README.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/README.md
new file mode 100644
index 000000000000..87e7ca03f86a
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/README.md
@@ -0,0 +1,107 @@
+# Azure.AI.Language.QuestionAnswering.Authoring client library for .NET
+
+Azure.AI.Language.QuestionAnswering.Authoring 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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/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.Language.QuestionAnswering.Authoring --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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Azure.AI.Language.QuestionAnswering.Authoring.csproj b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Azure.AI.Language.QuestionAnswering.Authoring.csproj
new file mode 100644
index 000000000000..58ba44f482bd
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Azure.AI.Language.QuestionAnswering.Authoring.csproj
@@ -0,0 +1,20 @@
+
+
+ This is the Azure.AI.Language.QuestionAnswering.Authoring client library for developing .NET applications with rich experience.
+ Azure SDK Code Generation Azure.AI.Language.QuestionAnswering.Authoring for Azure Data Plane
+ 1.0.0-beta.1
+ Azure.AI.Language.QuestionAnswering.Authoring
+ $(RequiredTargetFrameworks)
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringClientBuilderExtensions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringClientBuilderExtensions.cs
new file mode 100644
index 000000000000..ec2fe64c4fae
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringClientBuilderExtensions.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure;
+using Azure.AI.Language.QuestionAnswering.Authoring;
+using Azure.Core.Extensions;
+
+namespace Microsoft.Extensions.Azure
+{
+ /// Extension methods to add to client builder.
+ public static partial class AILanguageQuestionAnsweringAuthoringClientBuilderExtensions
+ {
+ /// Registers a instance.
+ /// The builder to register with.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ /// A credential used to authenticate to an Azure Service.
+ public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint, AzureKeyCredential credential)
+ where TBuilder : IAzureClientFactoryBuilder
+ {
+ return builder.RegisterClientFactory((options) => new AuthoringClient(endpoint, credential, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, Uri endpoint)
+ where TBuilder : IAzureClientFactoryBuilderWithCredential
+ {
+ return builder.RegisterClientFactory((options, cred) => new AuthoringClient(endpoint, cred, options));
+ }
+
+ /// Registers a instance.
+ /// The builder to register with.
+ /// The configuration values.
+ public static IAzureClientBuilder AddAuthoringClient(this TBuilder builder, TConfiguration configuration)
+ where TBuilder : IAzureClientFactoryBuilderWithConfiguration
+ {
+ return builder.RegisterClientFactory(configuration);
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringModelFactory.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringModelFactory.cs
new file mode 100644
index 000000000000..53804572806f
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AILanguageQuestionAnsweringAuthoringModelFactory.cs
@@ -0,0 +1,377 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ /// Model factory for models.
+ public static partial class AILanguageQuestionAnsweringAuthoringModelFactory
+ {
+ /// Initializes a new instance of .
+ /// Name of the project.
+ /// Description of the project.
+ ///
+ /// Language of the text records. This is BCP-47 representation of a language. For
+ /// example, use "en" for English; "es" for Spanish etc. If not set, use "en" for
+ /// English as default.
+ ///
+ /// Resource enabled for multiple languages across projects or not.
+ /// Configurable settings of the Project.
+ /// Project creation date-time.
+ /// Represents the project last modified date-time.
+ /// Represents the project last deployment date-time.
+ /// A new instance for mocking.
+ public static ProjectMetadata ProjectMetadata(string projectName = null, string description = null, string language = null, bool? multilingualResource = null, ProjectSettings settings = null, DateTimeOffset? createdDateTime = null, DateTimeOffset? lastModifiedDateTime = null, DateTimeOffset? lastDeployedDateTime = null)
+ {
+ return new ProjectMetadata(
+ projectName,
+ description,
+ language,
+ multilingualResource,
+ settings,
+ createdDateTime,
+ lastModifiedDateTime,
+ lastDeployedDateTime,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// One of a server-defined set of error codes.
+ /// A human-readable representation of the error.
+ /// The target of the error.
+ /// An array of details about specific errors that led to this reported error.
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ /// A new instance for mocking.
+ public static Error Error(ErrorCode code = default, string message = null, string target = null, IEnumerable details = null, InnerErrorModel innererror = null)
+ {
+ details ??= new List();
+
+ return new Error(
+ code,
+ message,
+ target,
+ details?.ToList(),
+ innererror,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// One of a server-defined set of error codes.
+ /// Error message.
+ /// Error details.
+ /// Error target.
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ /// A new instance for mocking.
+ public static InnerErrorModel InnerErrorModel(InnerErrorCode code = default, string message = null, IReadOnlyDictionary details = null, string target = null, InnerErrorModel innererror = null)
+ {
+ details ??= new Dictionary();
+
+ return new InnerErrorModel(
+ code,
+ message,
+ details,
+ target,
+ innererror,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Description of the project.
+ ///
+ /// Language of the text records. This is BCP-47 representation of a language. For
+ /// example, use "en" for English; "es" for Spanish etc. If not set, use "en" for
+ /// English as default.
+ ///
+ ///
+ /// Set to true to enable creating knowledgebases in different languages for the
+ /// same resource.
+ ///
+ /// Configurable settings of the Project.
+ /// A new instance for mocking.
+ public static CreateProjectOptions CreateProjectOptions(string description = null, string language = null, bool? multilingualResource = null, ProjectSettings settings = null)
+ {
+ return new CreateProjectOptions(description, language, multilingualResource, settings, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringProjectDeletionJobState QuestionAnsweringAuthoringProjectDeletionJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringProjectDeletionJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// URL to download the result of the Export Job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringExportJobState QuestionAnsweringAuthoringExportJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null, string resultUrl = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringExportJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ resultUrl,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique ID for the QnA.
+ /// Answer text.
+ ///
+ /// Source from which QnA was indexed e.g.
+ /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
+ ///
+ /// List of questions associated with the answer.
+ ///
+ /// Metadata associated with the answer, useful to categorize or filter question
+ /// answers.
+ ///
+ /// Context of a QnA.
+ /// List of Active Learning suggestions for the QnA.
+ /// Date-time when the QnA was last updated.
+ /// Friendly name of the Source.
+ /// A new instance for mocking.
+ public static ImportQnaRecord ImportQnaRecord(int id = default, string answer = null, string source = null, IEnumerable questions = null, IDictionary metadata = null, QnaDialog dialog = null, IEnumerable activeLearningSuggestions = null, DateTimeOffset? lastUpdatedDateTime = null, string sourceDisplayName = null)
+ {
+ questions ??= new List();
+ metadata ??= new Dictionary();
+ activeLearningSuggestions ??= new List();
+
+ return new ImportQnaRecord(
+ id,
+ answer,
+ source,
+ questions?.ToList(),
+ metadata,
+ dialog,
+ activeLearningSuggestions?.ToList(),
+ lastUpdatedDateTime,
+ sourceDisplayName,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique ID for the QnA.
+ /// Answer text.
+ ///
+ /// Source from which QnA was indexed e.g.
+ /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
+ ///
+ /// List of questions associated with the answer.
+ ///
+ /// Metadata associated with the answer, useful to categorize or filter question
+ /// answers.
+ ///
+ /// Context of a QnA.
+ /// List of Active Learning suggestions for the QnA.
+ /// A new instance for mocking.
+ public static QnaRecord QnaRecord(int id = default, string answer = null, string source = null, IEnumerable questions = null, IDictionary metadata = null, QnaDialog dialog = null, IEnumerable activeLearningSuggestions = null)
+ {
+ questions ??= new List();
+ metadata ??= new Dictionary();
+ activeLearningSuggestions ??= new List();
+
+ return new QnaRecord(
+ id,
+ answer,
+ source,
+ questions?.ToList(),
+ metadata,
+ dialog,
+ activeLearningSuggestions?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringImportJobState QuestionAnsweringAuthoringImportJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringImportJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringProjectDeploymentJobState QuestionAnsweringAuthoringProjectDeploymentJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringProjectDeploymentJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Name of the deployment.
+ /// Represents the project last deployment date-time.
+ /// A new instance for mocking.
+ public static ProjectDeployment ProjectDeployment(string deploymentName = null, DateTimeOffset? lastDeployedDateTime = null)
+ {
+ return new ProjectDeployment(deploymentName, lastDeployedDateTime, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Friendly name of the Source.
+ ///
+ /// Unique source identifier. Name of the file if it's a 'file' source; otherwise,
+ /// the complete URL if it's a 'url' source.
+ ///
+ /// URI location for the file or url.
+ /// Supported source types.
+ /// Content structure type for sources.
+ /// Date-time when the QnA was last updated.
+ /// A new instance for mocking.
+ public static QnaSourceRecord QnaSourceRecord(string displayName = null, string source = null, Uri sourceUri = null, SourceKind sourceKind = default, SourceContentStructureKind? contentStructureKind = null, DateTimeOffset? lastUpdatedDateTime = null)
+ {
+ return new QnaSourceRecord(
+ displayName,
+ source,
+ sourceUri,
+ sourceKind,
+ contentStructureKind,
+ lastUpdatedDateTime,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringUpdateSourcesJobState QuestionAnsweringAuthoringUpdateSourcesJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringUpdateSourcesJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// Unique ID for the QnA.
+ /// Answer text.
+ ///
+ /// Source from which QnA was indexed e.g.
+ /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
+ ///
+ /// List of questions associated with the answer.
+ ///
+ /// Metadata associated with the answer, useful to categorize or filter question
+ /// answers.
+ ///
+ /// Context of a QnA.
+ /// List of Active Learning suggestions for the QnA.
+ /// Date-time when the QnA was last updated.
+ /// A new instance for mocking.
+ public static RetrieveQnaRecord RetrieveQnaRecord(int id = default, string answer = null, string source = null, IEnumerable questions = null, IReadOnlyDictionary metadata = null, QnaDialog dialog = null, IEnumerable activeLearningSuggestions = null, DateTimeOffset? lastUpdatedDateTime = null)
+ {
+ questions ??= new List();
+ metadata ??= new Dictionary();
+ activeLearningSuggestions ??= new List();
+
+ return new RetrieveQnaRecord(
+ id,
+ answer,
+ source,
+ questions?.ToList(),
+ metadata,
+ dialog,
+ activeLearningSuggestions?.ToList(),
+ lastUpdatedDateTime,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The creation date time of the job.
+ /// The expiration date time of the job.
+ /// The job ID.
+ /// The last date time the job was updated.
+ /// Job Status.
+ /// The errors encountered while executing the job.
+ /// A new instance for mocking.
+ public static QuestionAnsweringAuthoringUpdateQnasJobState QuestionAnsweringAuthoringUpdateQnasJobState(DateTimeOffset createdDateTime = default, DateTimeOffset? expirationDateTime = null, string jobId = null, DateTimeOffset lastUpdatedDateTime = default, JobStatus status = default, IEnumerable errors = null)
+ {
+ errors ??= new List();
+
+ return new QuestionAnsweringAuthoringUpdateQnasJobState(
+ createdDateTime,
+ expirationDateTime,
+ jobId,
+ lastUpdatedDateTime,
+ status,
+ errors?.ToList(),
+ serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.Serialization.cs
new file mode 100644
index 000000000000..0ff7aeb45b1c
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.Serialization.cs
@@ -0,0 +1,159 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class ActiveLearningFeedback : 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(ActiveLearningFeedback)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsCollectionDefined(Records))
+ {
+ writer.WritePropertyName("records"u8);
+ writer.WriteStartArray();
+ foreach (var item in Records)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ ActiveLearningFeedback 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(ActiveLearningFeedback)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeActiveLearningFeedback(document.RootElement, options);
+ }
+
+ internal static ActiveLearningFeedback DeserializeActiveLearningFeedback(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IList records = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("records"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(FeedbackRecord.DeserializeFeedbackRecord(item, options));
+ }
+ records = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ActiveLearningFeedback(records ?? new ChangeTrackingList(), 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(ActiveLearningFeedback)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ActiveLearningFeedback 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 DeserializeActiveLearningFeedback(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ActiveLearningFeedback)} 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 ActiveLearningFeedback FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeActiveLearningFeedback(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.cs
new file mode 100644
index 000000000000..da4da9555946
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ActiveLearningFeedback.cs
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ /// Feedback for Active Learning.
+ public partial class ActiveLearningFeedback
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public ActiveLearningFeedback()
+ {
+ Records = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// A list of Feedback Records for Active Learning.
+ /// Keeps track of any properties unknown to the library.
+ internal ActiveLearningFeedback(IList records, IDictionary serializedAdditionalRawData)
+ {
+ Records = records;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// A list of Feedback Records for Active Learning.
+ public IList Records { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AssestKind.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AssestKind.cs
new file mode 100644
index 000000000000..fc83abf795f6
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AssestKind.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.Language.QuestionAnswering.Authoring
+{
+ /// Kind of the asset of the project.
+ public readonly partial struct AssestKind : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public AssestKind(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string QnasValue = "qnas";
+ private const string SynonymsValue = "synonyms";
+
+ /// Question and Answers.
+ public static AssestKind Qnas { get; } = new AssestKind(QnasValue);
+ /// Synonyms.
+ public static AssestKind Synonyms { get; } = new AssestKind(SynonymsValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(AssestKind left, AssestKind right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(AssestKind left, AssestKind right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator AssestKind(string value) => new AssestKind(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is AssestKind other && Equals(other);
+ ///
+ public bool Equals(AssestKind 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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.Serialization.cs
new file mode 100644
index 000000000000..c9ad27cde072
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.Serialization.cs
@@ -0,0 +1,184 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class Assets : 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(Assets)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsCollectionDefined(Synonyms))
+ {
+ writer.WritePropertyName("synonyms"u8);
+ writer.WriteStartArray();
+ foreach (var item in Synonyms)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsCollectionDefined(Qnas))
+ {
+ writer.WritePropertyName("qnas"u8);
+ writer.WriteStartArray();
+ foreach (var item in Qnas)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ Assets 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(Assets)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAssets(document.RootElement, options);
+ }
+
+ internal static Assets DeserializeAssets(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ IList synonyms = default;
+ IList qnas = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("synonyms"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(WordAlterations.DeserializeWordAlterations(item, options));
+ }
+ synonyms = array;
+ continue;
+ }
+ if (property.NameEquals("qnas"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(ImportQnaRecord.DeserializeImportQnaRecord(item, options));
+ }
+ qnas = array;
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Assets(synonyms ?? new ChangeTrackingList(), qnas ?? new ChangeTrackingList(), 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(Assets)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Assets 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 DeserializeAssets(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Assets)} 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 Assets FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAssets(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.cs
new file mode 100644
index 000000000000..dd7c996a382d
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Assets.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.Language.QuestionAnswering.Authoring
+{
+ /// All assets for this project.
+ public partial class Assets
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public Assets()
+ {
+ Synonyms = new ChangeTrackingList();
+ Qnas = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// Collection of synonyms.
+ /// List of QnA records to import.
+ /// Keeps track of any properties unknown to the library.
+ internal Assets(IList synonyms, IList qnas, IDictionary serializedAdditionalRawData)
+ {
+ Synonyms = synonyms;
+ Qnas = qnas;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Collection of synonyms.
+ public IList Synonyms { get; }
+ /// List of QnA records to import.
+ public IList Qnas { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClient.cs
new file mode 100644
index 000000000000..5ccb2ef1c2c5
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClient.cs
@@ -0,0 +1,103 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ // Data plane generated client.
+ ///
+ /// The language service API is a suite of natural language processing (NLP) skills
+ /// built with best-in-class Microsoft machine learning algorithms. The API can be
+ /// used to analyze unstructured text for tasks such as sentiment analysis, key
+ /// phrase extraction, language detection and question answering. Further
+ /// documentation can be found in <a
+ /// href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview">https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview</a>.
+ ///
+ public partial class AuthoringClient
+ {
+ private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key";
+ private readonly AzureKeyCredential _keyCredential;
+ 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 AuthoringClient for mocking.
+ protected AuthoringClient()
+ {
+ }
+
+ /// Initializes a new instance of AuthoringClient.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AuthoringClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new AuthoringClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AuthoringClient.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ /// A credential used to authenticate to an Azure Service.
+ /// or is null.
+ public AuthoringClient(Uri endpoint, TokenCredential credential) : this(endpoint, credential, new AuthoringClientOptions())
+ {
+ }
+
+ /// Initializes a new instance of AuthoringClient.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public AuthoringClient(Uri endpoint, AzureKeyCredential credential, AuthoringClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new AuthoringClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _keyCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ /// Initializes a new instance of AuthoringClient.
+ /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com).
+ /// A credential used to authenticate to an Azure Service.
+ /// The options for configuring the client.
+ /// or is null.
+ public AuthoringClient(Uri endpoint, TokenCredential credential, AuthoringClientOptions options)
+ {
+ Argument.AssertNotNull(endpoint, nameof(endpoint));
+ Argument.AssertNotNull(credential, nameof(credential));
+ options ??= new AuthoringClientOptions();
+
+ ClientDiagnostics = new ClientDiagnostics(options, true);
+ _tokenCredential = credential;
+ _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new BearerTokenAuthenticationPolicy(_tokenCredential, AuthorizationScopes) }, new ResponseClassifier());
+ _endpoint = endpoint;
+ }
+
+ /// Initializes a new instance of QuestionAnsweringProjects.
+ /// The API version to use for this operation.
+ /// is null.
+ public virtual QuestionAnsweringProjects GetQuestionAnsweringProjectsClient(string apiVersion = "2023-04-01")
+ {
+ Argument.AssertNotNull(apiVersion, nameof(apiVersion));
+
+ return new QuestionAnsweringProjects(ClientDiagnostics, _pipeline, _keyCredential, _tokenCredential, _endpoint, apiVersion);
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClientOptions.cs
new file mode 100644
index 000000000000..e0653a6a83fc
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/AuthoringClientOptions.cs
@@ -0,0 +1,37 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using Azure.Core;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ /// Client options for AuthoringClient.
+ public partial class AuthoringClientOptions : ClientOptions
+ {
+ private const ServiceVersion LatestVersion = ServiceVersion.V2023_04_01;
+
+ /// The version of the service to use.
+ public enum ServiceVersion
+ {
+ /// Service version "2023-04-01".
+ V2023_04_01 = 1,
+ }
+
+ internal string Version { get; }
+
+ /// Initializes new instance of AuthoringClientOptions.
+ public AuthoringClientOptions(ServiceVersion version = LatestVersion)
+ {
+ Version = version switch
+ {
+ ServiceVersion.V2023_04_01 => "2023-04-01",
+ _ => throw new NotSupportedException()
+ };
+ }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.Serialization.cs
new file mode 100644
index 000000000000..a55e317c241e
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.Serialization.cs
@@ -0,0 +1,183 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class CreateProjectOptions : 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(CreateProjectOptions)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(Description))
+ {
+ writer.WritePropertyName("description"u8);
+ writer.WriteStringValue(Description);
+ }
+ writer.WritePropertyName("language"u8);
+ writer.WriteStringValue(Language);
+ if (Optional.IsDefined(MultilingualResource))
+ {
+ writer.WritePropertyName("multilingualResource"u8);
+ writer.WriteBooleanValue(MultilingualResource.Value);
+ }
+ if (Optional.IsDefined(Settings))
+ {
+ writer.WritePropertyName("settings"u8);
+ writer.WriteObjectValue(Settings, 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
+ }
+ }
+ }
+
+ CreateProjectOptions 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(CreateProjectOptions)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeCreateProjectOptions(document.RootElement, options);
+ }
+
+ internal static CreateProjectOptions DeserializeCreateProjectOptions(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string description = default;
+ string language = default;
+ bool? multilingualResource = default;
+ ProjectSettings settings = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("description"u8))
+ {
+ description = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("language"u8))
+ {
+ language = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("multilingualResource"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ multilingualResource = property.Value.GetBoolean();
+ continue;
+ }
+ if (property.NameEquals("settings"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ settings = ProjectSettings.DeserializeProjectSettings(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new CreateProjectOptions(description, language, multilingualResource, settings, 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(CreateProjectOptions)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ CreateProjectOptions 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 DeserializeCreateProjectOptions(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(CreateProjectOptions)} 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 CreateProjectOptions FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeCreateProjectOptions(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.cs
new file mode 100644
index 000000000000..f77ace1f3d7b
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/CreateProjectOptions.cs
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ /// Parameters needed to create the project.
+ public partial class CreateProjectOptions
+ {
+ ///
+ /// 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 .
+ ///
+ /// Language of the text records. This is BCP-47 representation of a language. For
+ /// example, use "en" for English; "es" for Spanish etc. If not set, use "en" for
+ /// English as default.
+ ///
+ /// is null.
+ public CreateProjectOptions(string language)
+ {
+ Argument.AssertNotNull(language, nameof(language));
+
+ Language = language;
+ }
+
+ /// Initializes a new instance of .
+ /// Description of the project.
+ ///
+ /// Language of the text records. This is BCP-47 representation of a language. For
+ /// example, use "en" for English; "es" for Spanish etc. If not set, use "en" for
+ /// English as default.
+ ///
+ ///
+ /// Set to true to enable creating knowledgebases in different languages for the
+ /// same resource.
+ ///
+ /// Configurable settings of the Project.
+ /// Keeps track of any properties unknown to the library.
+ internal CreateProjectOptions(string description, string language, bool? multilingualResource, ProjectSettings settings, IDictionary serializedAdditionalRawData)
+ {
+ Description = description;
+ Language = language;
+ MultilingualResource = multilingualResource;
+ Settings = settings;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal CreateProjectOptions()
+ {
+ }
+
+ /// Description of the project.
+ public string Description { get; set; }
+ ///
+ /// Language of the text records. This is BCP-47 representation of a language. For
+ /// example, use "en" for English; "es" for Spanish etc. If not set, use "en" for
+ /// English as default.
+ ///
+ public string Language { get; }
+ ///
+ /// Set to true to enable creating knowledgebases in different languages for the
+ /// same resource.
+ ///
+ public bool? MultilingualResource { get; set; }
+ /// Configurable settings of the Project.
+ public ProjectSettings Settings { get; set; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Docs/QuestionAnsweringAuthoringClient.xml b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Docs/QuestionAnsweringProjects.xml
similarity index 58%
rename from sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Docs/QuestionAnsweringAuthoringClient.xml
rename to sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Docs/QuestionAnsweringProjects.xml
index 615c97280772..fcc632b9dfc9 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Docs/QuestionAnsweringAuthoringClient.xml
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Docs/QuestionAnsweringProjects.xml
@@ -1,26 +1,64 @@
+
+
+This sample shows how to call GetProjectDetailsAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetProjectDetailsAsync("");
+]]>
+This sample shows how to call GetProjectDetailsAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetProjectDetailsAsync("");
+]]>
+
+
+
+This sample shows how to call GetProjectDetails.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetProjectDetails("");
+]]>
+This sample shows how to call GetProjectDetails with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetProjectDetails("");
+]]>
+
This sample shows how to call GetProjectDetailsAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetProjectDetailsAsync("");
+Response response = await client.GetProjectDetailsAsync("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.ToString());
+Console.WriteLine(result.GetProperty("projectName").ToString());
]]>
This sample shows how to call GetProjectDetailsAsync with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetProjectDetailsAsync("");
+Response response = await client.GetProjectDetailsAsync("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
@@ -39,20 +77,20 @@ This sample shows how to call GetProjectDetails and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetProjectDetails("");
+Response response = client.GetProjectDetails("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.ToString());
+Console.WriteLine(result.GetProperty("projectName").ToString());
]]>
This sample shows how to call GetProjectDetails with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetProjectDetails("");
+Response response = client.GetProjectDetails("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
@@ -71,7 +109,7 @@ This sample shows how to call CreateProjectAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -80,13 +118,13 @@ using RequestContent content = RequestContent.Create(new
Response response = await client.CreateProjectAsync("", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.ToString());
+Console.WriteLine(result.GetProperty("projectName").ToString());
]]>
This sample shows how to call CreateProjectAsync with all parameters and request content and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -117,7 +155,7 @@ This sample shows how to call CreateProject and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -126,13 +164,13 @@ using RequestContent content = RequestContent.Create(new
Response response = client.CreateProject("", content);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.ToString());
+Console.WriteLine(result.GetProperty("projectName").ToString());
]]>
This sample shows how to call CreateProject with all parameters and request content and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -155,6 +193,44 @@ Console.WriteLine(result.GetProperty("settings").GetProperty("defaultAnswer").To
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("lastModifiedDateTime").ToString());
Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
+]]>
+
+
+
+This sample shows how to call GetDeleteStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetDeleteStatusAsync("");
+]]>
+This sample shows how to call GetDeleteStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetDeleteStatusAsync("");
+]]>
+
+
+
+This sample shows how to call GetDeleteStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetDeleteStatus("");
+]]>
+This sample shows how to call GetDeleteStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetDeleteStatus("");
]]>
@@ -163,9 +239,9 @@ This sample shows how to call GetDeleteStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetDeleteStatusAsync("");
+Response response = await client.GetDeleteStatusAsync("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -177,11 +253,16 @@ This sample shows how to call GetDeleteStatusAsync with all parameters and parse
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetDeleteStatusAsync("");
+Response response = await client.GetDeleteStatusAsync("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -196,11 +277,6 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
@@ -209,9 +285,9 @@ This sample shows how to call GetDeleteStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetDeleteStatus("");
+Response response = client.GetDeleteStatus("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -223,11 +299,16 @@ This sample shows how to call GetDeleteStatus with all parameters and parse the
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetDeleteStatus("");
+Response response = client.GetDeleteStatus("", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -242,11 +323,44 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call GetExportStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetExportStatusAsync("", "");
+]]>
+This sample shows how to call GetExportStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetExportStatusAsync("", "");
+]]>
+
+
+
+This sample shows how to call GetExportStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetExportStatus("", "");
+]]>
+This sample shows how to call GetExportStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetExportStatus("", "");
]]>
@@ -255,27 +369,31 @@ This sample shows how to call GetExportStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetExportStatusAsync("", "");
+Response response = await client.GetExportStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
+Console.WriteLine(result.GetProperty("resultUrl").ToString());
]]>
This sample shows how to call GetExportStatusAsync with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetExportStatusAsync("", "");
+Response response = await client.GetExportStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -290,11 +408,7 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Console.WriteLine(result.GetProperty("resultUrl").ToString());
]]>
@@ -303,27 +417,31 @@ This sample shows how to call GetExportStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetExportStatus("", "");
+Response response = client.GetExportStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
Console.WriteLine(result.GetProperty("jobId").ToString());
Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("status").ToString());
+Console.WriteLine(result.GetProperty("resultUrl").ToString());
]]>
This sample shows how to call GetExportStatus with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetExportStatus("", "");
+Response response = client.GetExportStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -338,11 +456,45 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Console.WriteLine(result.GetProperty("resultUrl").ToString());
+]]>
+
+
+
+This sample shows how to call GetImportStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetImportStatusAsync("", "");
+]]>
+This sample shows how to call GetImportStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetImportStatusAsync("", "");
+]]>
+
+
+
+This sample shows how to call GetImportStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetImportStatus("", "");
+]]>
+This sample shows how to call GetImportStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetImportStatus("", "");
]]>
@@ -351,9 +503,9 @@ This sample shows how to call GetImportStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetImportStatusAsync("", "");
+Response response = await client.GetImportStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -365,11 +517,16 @@ This sample shows how to call GetImportStatusAsync with all parameters and parse
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetImportStatusAsync("", "");
+Response response = await client.GetImportStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -384,11 +541,6 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
@@ -397,9 +549,9 @@ This sample shows how to call GetImportStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetImportStatus("", "");
+Response response = client.GetImportStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -411,11 +563,16 @@ This sample shows how to call GetImportStatus with all parameters and parse the
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetImportStatus("", "");
+Response response = client.GetImportStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -430,11 +587,44 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call GetDeployStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetDeployStatusAsync("", "", "");
+]]>
+This sample shows how to call GetDeployStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetDeployStatusAsync("", "", "");
+]]>
+
+
+
+This sample shows how to call GetDeployStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetDeployStatus("", "", "");
+]]>
+This sample shows how to call GetDeployStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetDeployStatus("", "", "");
]]>
@@ -443,9 +633,9 @@ This sample shows how to call GetDeployStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetDeployStatusAsync("", "", "");
+Response response = await client.GetDeployStatusAsync("", "", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -457,11 +647,16 @@ This sample shows how to call GetDeployStatusAsync with all parameters and parse
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetDeployStatusAsync("", "", "");
+Response response = await client.GetDeployStatusAsync("", "", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -476,11 +671,6 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
@@ -489,9 +679,9 @@ This sample shows how to call GetDeployStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetDeployStatus("", "", "");
+Response response = client.GetDeployStatus("", "", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -503,11 +693,16 @@ This sample shows how to call GetDeployStatus with all parameters and parse the
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetDeployStatus("", "", "");
+Response response = client.GetDeployStatus("", "", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -522,69 +717,75 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
-
+
This sample shows how to call UpdateSynonymsAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-using RequestContent content = RequestContent.Create(new object());
-Response response = await client.UpdateSynonymsAsync("", content);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Console.WriteLine(response.Status);
+SynonymAssets body = new SynonymAssets(new WordAlterations[]
+{
+ new WordAlterations(new string[]{""})
+});
+Response response = await client.UpdateSynonymsAsync("", body);
]]>
-This sample shows how to call UpdateSynonymsAsync with all parameters and request content.
+This sample shows how to call UpdateSynonymsAsync with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-using RequestContent content = RequestContent.Create(new
+SynonymAssets body = new SynonymAssets(new WordAlterations[]
{
- value = new object[]
- {
- new
- {
- alterations = new object[]
- {
- ""
- },
- }
- },
- nextLink = "",
-});
-Response response = await client.UpdateSynonymsAsync("", content);
-
-Console.WriteLine(response.Status);
+ new WordAlterations(new string[]{""})
+})
+{
+ NextLink = new Uri("http://localhost:3000"),
+};
+Response response = await client.UpdateSynonymsAsync("", body);
]]>
-
+
This sample shows how to call UpdateSynonyms.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-using RequestContent content = RequestContent.Create(new object());
-Response response = client.UpdateSynonyms("", content);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Console.WriteLine(response.Status);
+SynonymAssets body = new SynonymAssets(new WordAlterations[]
+{
+ new WordAlterations(new string[]{""})
+});
+Response response = client.UpdateSynonyms("", body);
]]>
-This sample shows how to call UpdateSynonyms with all parameters and request content.
+This sample shows how to call UpdateSynonyms with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+SynonymAssets body = new SynonymAssets(new WordAlterations[]
+{
+ new WordAlterations(new string[]{""})
+})
+{
+ NextLink = new Uri("http://localhost:3000"),
+};
+Response response = client.UpdateSynonyms("", body);
+]]>
+
+
+
+This sample shows how to call UpdateSynonymsAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -598,11 +799,122 @@ using RequestContent content = RequestContent.Create(new
},
}
},
- nextLink = "",
});
-Response response = client.UpdateSynonyms("", content);
+Response response = await client.UpdateSynonymsAsync("", content);
+
+Console.WriteLine(response.Status);
+]]>
+This sample shows how to call UpdateSynonymsAsync with all parameters and request content.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+using RequestContent content = RequestContent.Create(new
+{
+ value = new object[]
+ {
+ new
+ {
+ alterations = new object[]
+ {
+ ""
+ },
+ }
+ },
+ nextLink = "http://localhost:3000",
+});
+Response response = await client.UpdateSynonymsAsync("", content);
Console.WriteLine(response.Status);
+]]>
+
+
+
+This sample shows how to call UpdateSynonyms.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+using RequestContent content = RequestContent.Create(new
+{
+ value = new object[]
+ {
+ new
+ {
+ alterations = new object[]
+ {
+ ""
+ },
+ }
+ },
+});
+Response response = client.UpdateSynonyms("", content);
+
+Console.WriteLine(response.Status);
+]]>
+This sample shows how to call UpdateSynonyms with all parameters and request content.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+using RequestContent content = RequestContent.Create(new
+{
+ value = new object[]
+ {
+ new
+ {
+ alterations = new object[]
+ {
+ ""
+ },
+ }
+ },
+ nextLink = "http://localhost:3000",
+});
+Response response = client.UpdateSynonyms("", content);
+
+Console.WriteLine(response.Status);
+]]>
+
+
+
+This sample shows how to call GetUpdateSourcesStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetUpdateSourcesStatusAsync("", "");
+]]>
+This sample shows how to call GetUpdateSourcesStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetUpdateSourcesStatusAsync("", "");
+]]>
+
+
+
+This sample shows how to call GetUpdateSourcesStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetUpdateSourcesStatus("", "");
+]]>
+This sample shows how to call GetUpdateSourcesStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetUpdateSourcesStatus("", "");
]]>
@@ -611,9 +923,9 @@ This sample shows how to call GetUpdateSourcesStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetUpdateSourcesStatusAsync("", "");
+Response response = await client.GetUpdateSourcesStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -625,11 +937,16 @@ This sample shows how to call GetUpdateSourcesStatusAsync with all parameters an
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetUpdateSourcesStatusAsync("", "");
+Response response = await client.GetUpdateSourcesStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -644,11 +961,6 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
@@ -657,9 +969,9 @@ This sample shows how to call GetUpdateSourcesStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetUpdateSourcesStatus("", "");
+Response response = client.GetUpdateSourcesStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -671,11 +983,16 @@ This sample shows how to call GetUpdateSourcesStatus with all parameters and par
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetUpdateSourcesStatus("", "");
+Response response = client.GetUpdateSourcesStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -690,11 +1007,44 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call GetUpdateQnasStatusAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetUpdateQnasStatusAsync("", "");
+]]>
+This sample shows how to call GetUpdateQnasStatusAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = await client.GetUpdateQnasStatusAsync("", "");
+]]>
+
+
+
+This sample shows how to call GetUpdateQnasStatus.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetUpdateQnasStatus("", "");
+]]>
+This sample shows how to call GetUpdateQnasStatus with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Response response = client.GetUpdateQnasStatus("", "");
]]>
@@ -703,9 +1053,9 @@ This sample shows how to call GetUpdateQnasStatusAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetUpdateQnasStatusAsync("", "");
+Response response = await client.GetUpdateQnasStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -717,11 +1067,16 @@ This sample shows how to call GetUpdateQnasStatusAsync with all parameters and p
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = await client.GetUpdateQnasStatusAsync("", "");
+Response response = await client.GetUpdateQnasStatusAsync("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -736,11 +1091,6 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
]]>
@@ -749,9 +1099,9 @@ This sample shows how to call GetUpdateQnasStatus and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetUpdateQnasStatus("", "");
+Response response = client.GetUpdateQnasStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("createdDateTime").ToString());
@@ -763,11 +1113,16 @@ This sample shows how to call GetUpdateQnasStatus with all parameters and parse
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Response response = client.GetUpdateQnasStatus("", "");
+Response response = client.GetUpdateQnasStatus("", "", null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
+Console.WriteLine(result.GetProperty("createdDateTime").ToString());
+Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
+Console.WriteLine(result.GetProperty("jobId").ToString());
+Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+Console.WriteLine(result.GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
@@ -782,11 +1137,64 @@ Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetP
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+]]>
+
+
+
+This sample shows how to call AddFeedbackAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+ActiveLearningFeedback body = new ActiveLearningFeedback();
+Response response = await client.AddFeedbackAsync("", body);
+]]>
+This sample shows how to call AddFeedbackAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+ActiveLearningFeedback body = new ActiveLearningFeedback
+{
+ Records = {new FeedbackRecord
+ {
+ UserId = "",
+ UserQuestion = "",
+ QnaId = 1234,
+ }},
+};
+Response response = await client.AddFeedbackAsync("", body);
+]]>
+
+
+
+This sample shows how to call AddFeedback.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+ActiveLearningFeedback body = new ActiveLearningFeedback();
+Response response = client.AddFeedback("", body);
+]]>
+This sample shows how to call AddFeedback with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+ActiveLearningFeedback body = new ActiveLearningFeedback
+{
+ Records = {new FeedbackRecord
+ {
+ UserId = "",
+ UserQuestion = "",
+ QnaId = 1234,
+ }},
+};
+Response response = client.AddFeedback("", body);
]]>
@@ -795,7 +1203,7 @@ This sample shows how to call AddFeedbackAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object());
Response response = await client.AddFeedbackAsync("", content);
@@ -806,7 +1214,7 @@ This sample shows how to call AddFeedbackAsync with all parameters and request c
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -831,7 +1239,7 @@ This sample shows how to call AddFeedback.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object());
Response response = client.AddFeedback("", content);
@@ -842,7 +1250,7 @@ This sample shows how to call AddFeedback with all parameters and request conten
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -861,27 +1269,73 @@ Response response = client.AddFeedback("", content);
Console.WriteLine(response.Status);
]]>
-
+
+
+This sample shows how to call GetProjectsAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (ProjectMetadata item in client.GetProjectsAsync())
+{
+}
+]]>
+This sample shows how to call GetProjectsAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (ProjectMetadata item in client.GetProjectsAsync(maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetProjects.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (ProjectMetadata item in client.GetProjects())
+{
+}
+]]>
+This sample shows how to call GetProjects with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (ProjectMetadata item in client.GetProjects(maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
This sample shows how to call GetProjectsAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetProjectsAsync())
+await foreach (BinaryData item in client.GetProjectsAsync(null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("projectName").ToString());
}
]]>
-This sample shows how to call GetProjectsAsync with all request content and parse the result.
+This sample shows how to call GetProjectsAsync with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetProjectsAsync())
+await foreach (BinaryData item in client.GetProjectsAsync(1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
@@ -895,27 +1349,27 @@ await foreach (BinaryData item in client.GetProjectsAsync())
}
]]>
-
+
This sample shows how to call GetProjects and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetProjects())
+foreach (BinaryData item in client.GetProjects(null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("projectName").ToString());
}
]]>
-This sample shows how to call GetProjects with all request content and parse the result.
+This sample shows how to call GetProjects with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetProjects())
+foreach (BinaryData item in client.GetProjects(1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("projectName").ToString());
@@ -929,27 +1383,73 @@ foreach (BinaryData item in client.GetProjects())
}
]]>
-
+
+
+This sample shows how to call GetDeploymentsAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (ProjectDeployment item in client.GetDeploymentsAsync(""))
+{
+}
+]]>
+This sample shows how to call GetDeploymentsAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (ProjectDeployment item in client.GetDeploymentsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetDeployments.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (ProjectDeployment item in client.GetDeployments(""))
+{
+}
+]]>
+This sample shows how to call GetDeployments with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (ProjectDeployment item in client.GetDeployments("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
This sample shows how to call GetDeploymentsAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetDeploymentsAsync(""))
+await foreach (BinaryData item in client.GetDeploymentsAsync("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("deploymentName").ToString());
}
]]>
This sample shows how to call GetDeploymentsAsync with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetDeploymentsAsync(""))
+await foreach (BinaryData item in client.GetDeploymentsAsync("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
@@ -957,27 +1457,27 @@ await foreach (BinaryData item in client.GetDeploymentsAsync(""))
}
]]>
-
+
This sample shows how to call GetDeployments and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetDeployments(""))
+foreach (BinaryData item in client.GetDeployments("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("deploymentName").ToString());
}
]]>
This sample shows how to call GetDeployments with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetDeployments(""))
+foreach (BinaryData item in client.GetDeployments("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("deploymentName").ToString());
@@ -985,15 +1485,61 @@ foreach (BinaryData item in client.GetDeployments(""))
}
]]>
-
+
+
+This sample shows how to call GetSynonymsAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (WordAlterations item in client.GetSynonymsAsync(""))
+{
+}
+]]>
+This sample shows how to call GetSynonymsAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (WordAlterations item in client.GetSynonymsAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetSynonyms.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (WordAlterations item in client.GetSynonyms(""))
+{
+}
+]]>
+This sample shows how to call GetSynonyms with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (WordAlterations item in client.GetSynonyms("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
This sample shows how to call GetSynonymsAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetSynonymsAsync(""))
+await foreach (BinaryData item in client.GetSynonymsAsync("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
@@ -1003,24 +1549,24 @@ This sample shows how to call GetSynonymsAsync with all parameters and parse the
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetSynonymsAsync(""))
+await foreach (BinaryData item in client.GetSynonymsAsync("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
}
]]>
-
+
This sample shows how to call GetSynonyms and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetSynonyms(""))
+foreach (BinaryData item in client.GetSynonyms("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
@@ -1030,26 +1576,73 @@ This sample shows how to call GetSynonyms with all parameters and parse the resu
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetSynonyms(""))
+foreach (BinaryData item in client.GetSynonyms("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
Console.WriteLine(result.GetProperty("alterations")[0].ToString());
}
]]>
-
+
+
+This sample shows how to call GetSourcesAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (QnaSourceRecord item in client.GetSourcesAsync(""))
+{
+}
+]]>
+This sample shows how to call GetSourcesAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (QnaSourceRecord item in client.GetSourcesAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
+
+This sample shows how to call GetSources.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (QnaSourceRecord item in client.GetSources(""))
+{
+}
+]]>
+This sample shows how to call GetSources with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (QnaSourceRecord item in client.GetSources("", maxCount: 1234, skip: 1234, maxpagesize: 1234))
+{
+}
+]]>
+
+
This sample shows how to call GetSourcesAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetSourcesAsync(""))
+await foreach (BinaryData item in client.GetSourcesAsync("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
+ Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
}
@@ -1058,31 +1651,32 @@ This sample shows how to call GetSourcesAsync with all parameters and parse the
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetSourcesAsync(""))
+await foreach (BinaryData item in client.GetSourcesAsync("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
+ Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
}
]]>
-
+
This sample shows how to call GetSources and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetSources(""))
+foreach (BinaryData item in client.GetSources("", null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
+ Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
}
@@ -1091,44 +1685,89 @@ This sample shows how to call GetSources with all parameters and parse the resul
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetSources(""))
+foreach (BinaryData item in client.GetSources("", 1234, 1234, 1234, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("displayName").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
Console.WriteLine(result.GetProperty("sourceUri").ToString());
Console.WriteLine(result.GetProperty("sourceKind").ToString());
Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
+ Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
+}
+]]>
+
+
+
+This sample shows how to call GetQnasAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (RetrieveQnaRecord item in client.GetQnasAsync(""))
+{
+}
+]]>
+This sample shows how to call GetQnasAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+await foreach (RetrieveQnaRecord item in client.GetQnasAsync("", maxCount: 1234, skip: 1234, maxpagesize: 1234, source: ""))
+{
}
]]>
-
+
+
+This sample shows how to call GetQnas.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (RetrieveQnaRecord item in client.GetQnas(""))
+{
+}
+]]>
+This sample shows how to call GetQnas with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+foreach (RetrieveQnaRecord item in client.GetQnas("", maxCount: 1234, skip: 1234, maxpagesize: 1234, source: ""))
+{
+}
+]]>
+
+
This sample shows how to call GetQnasAsync and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetQnasAsync(""))
+await foreach (BinaryData item in client.GetQnasAsync("", null, null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("id").ToString());
}
]]>
This sample shows how to call GetQnasAsync with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-await foreach (BinaryData item in client.GetQnasAsync("", source: ""))
+await foreach (BinaryData item in client.GetQnasAsync("", 1234, 1234, 1234, "", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
@@ -1151,33 +1790,33 @@ await foreach (BinaryData item in client.GetQnasAsync("", source: "
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
+ Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
}
]]>
-
+
This sample shows how to call GetQnas and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetQnas(""))
+foreach (BinaryData item in client.GetQnas("", null, null, null, null, null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
+ Console.WriteLine(result.GetProperty("id").ToString());
}
]]>
This sample shows how to call GetQnas with all parameters and parse the result.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-foreach (BinaryData item in client.GetQnas("", source: ""))
+foreach (BinaryData item in client.GetQnas("", 1234, 1234, 1234, "", null))
{
JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
Console.WriteLine(result.GetProperty("id").ToString());
Console.WriteLine(result.GetProperty("answer").ToString());
Console.WriteLine(result.GetProperty("source").ToString());
@@ -1200,6 +1839,7 @@ foreach (BinaryData item in client.GetQnas("", source: ""))
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
+ Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
}
]]>
@@ -1209,161 +1849,290 @@ This sample shows how to call DeleteProjectAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, "");
]]>
-This sample shows how to call DeleteProjectAsync with all parameters.
+This sample shows how to call DeleteProjectAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, "");
+]]>
+
+
+
+This sample shows how to call DeleteProject.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = client.DeleteProject(WaitUntil.Completed, "");
+]]>
+This sample shows how to call DeleteProject with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = client.DeleteProject(WaitUntil.Completed, "");
+]]>
+
+
+
+This sample shows how to call ExportAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = await client.ExportAsync(WaitUntil.Completed, "");
+]]>
+This sample shows how to call ExportAsync with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = await client.ExportAsync(WaitUntil.Completed, "", format: ImportExportFormat.Json, assetKind: AssestKind.Qnas);
+]]>
+
+
+
+This sample shows how to call Export.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = client.Export(WaitUntil.Completed, "");
+]]>
+This sample shows how to call Export with all parameters.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = client.Export(WaitUntil.Completed, "", format: ImportExportFormat.Json, assetKind: AssestKind.Qnas);
+]]>
+
+
+
+This sample shows how to call ExportAsync.
+");
+AzureKeyCredential credential = new AzureKeyCredential("");
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
+
+Operation operation = await client.ExportAsync(WaitUntil.Completed, "", null, null, null);
+]]>
+This sample shows how to call ExportAsync with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Operation operation = await client.DeleteProjectAsync(WaitUntil.Completed, "");
+Operation operation = await client.ExportAsync(WaitUntil.Completed, "", "json", "qnas", null);
]]>
-
+
-This sample shows how to call DeleteProject.
+This sample shows how to call Export.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Operation operation = client.DeleteProject(WaitUntil.Completed, "");
+Operation operation = client.Export(WaitUntil.Completed, "", null, null, null);
]]>
-This sample shows how to call DeleteProject with all parameters.
+This sample shows how to call Export with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Operation operation = client.DeleteProject(WaitUntil.Completed, "");
+Operation operation = client.Export(WaitUntil.Completed, "", "json", "qnas", null);
]]>
-
+
-This sample shows how to call ExportAsync and parse the result.
+This sample shows how to call ImportAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = await client.ExportAsync(WaitUntil.Completed, "");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = await client.ImportAsync(WaitUntil.Completed, "");
]]>
-This sample shows how to call ExportAsync with all parameters and parse the result.
+This sample shows how to call ImportAsync with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = await client.ExportAsync(WaitUntil.Completed, "", format: "json", assetKind: "qnas");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+ImportJobOptions body = new ImportJobOptions
+{
+ Metadata = new CreateProjectOptions("")
+ {
+ Description = "",
+ MultilingualResource = true,
+ Settings = new ProjectSettings
+ {
+ DefaultAnswer = "",
+ },
+ },
+ Assets = new Assets
+ {
+ Synonyms = { new WordAlterations(new string[] { "" }) },
+ Qnas = {new ImportQnaRecord
+ {
+ Answer = "",
+ Source = "",
+ Questions = {""},
+ Metadata =
+ {
+ ["key"] = ""
+ },
+ Dialog = new QnaDialog
+ {
+ IsContextOnly = true,
+ Prompts = {new QnaPrompt
+ {
+ DisplayOrder = 1234,
+ QnaId = 1234,
+ Qna = new QnaRecord
+ {
+ Answer = "",
+ Source = "",
+ Questions = {""},
+ Metadata =
+ {
+ ["key"] = ""
+ },
+ Dialog = default,
+ ActiveLearningSuggestions = {new SuggestedQuestionsCluster
+ {
+ ClusterHead = "",
+ SuggestedQuestions = {new SuggestedQuestion
+ {
+ Question = "",
+ UserSuggestedCount = 1234,
+ AutoSuggestedCount = 1234,
+ }},
+ }},
+ },
+ DisplayText = "",
+ }},
+ },
+ ActiveLearningSuggestions = {default},
+ LastUpdatedDateTime = DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"),
+ SourceDisplayName = "",
+ }},
+ },
+ FileUri = "",
+};
+Operation operation = await client.ImportAsync(WaitUntil.Completed, "", body: body, format: ImportExportFormat.Json, assetKind: AssestKind.Qnas);
]]>
-
+
-This sample shows how to call Export and parse the result.
+This sample shows how to call Import.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = client.Export(WaitUntil.Completed, "");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = client.Import(WaitUntil.Completed, "");
]]>
-This sample shows how to call Export with all parameters and parse the result.
+This sample shows how to call Import with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = client.Export(WaitUntil.Completed, "", format: "json", assetKind: "qnas");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("resultUrl").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+ImportJobOptions body = new ImportJobOptions
+{
+ Metadata = new CreateProjectOptions("")
+ {
+ Description = "",
+ MultilingualResource = true,
+ Settings = new ProjectSettings
+ {
+ DefaultAnswer = "",
+ },
+ },
+ Assets = new Assets
+ {
+ Synonyms = { new WordAlterations(new string[] { "" }) },
+ Qnas = {new ImportQnaRecord
+ {
+ Answer = "",
+ Source = "",
+ Questions = {""},
+ Metadata =
+ {
+ ["key"] = ""
+ },
+ Dialog = new QnaDialog
+ {
+ IsContextOnly = true,
+ Prompts = {new QnaPrompt
+ {
+ DisplayOrder = 1234,
+ QnaId = 1234,
+ Qna = new QnaRecord
+ {
+ Answer = "",
+ Source = "",
+ Questions = {""},
+ Metadata =
+ {
+ ["key"] = ""
+ },
+ Dialog = default,
+ ActiveLearningSuggestions = {new SuggestedQuestionsCluster
+ {
+ ClusterHead = "",
+ SuggestedQuestions = {new SuggestedQuestion
+ {
+ Question = "",
+ UserSuggestedCount = 1234,
+ AutoSuggestedCount = 1234,
+ }},
+ }},
+ },
+ DisplayText = "",
+ }},
+ },
+ ActiveLearningSuggestions = {default},
+ LastUpdatedDateTime = DateTimeOffset.Parse("2022-05-10T18:57:31.2311892Z"),
+ SourceDisplayName = "",
+ }},
+ },
+ FileUri = "",
+};
+Operation operation = client.Import(WaitUntil.Completed, "", body: body, format: ImportExportFormat.Json, assetKind: AssestKind.Qnas);
]]>
-This sample shows how to call ImportAsync and parse the result.
+This sample shows how to call ImportAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = null;
-Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content);
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call ImportAsync with all parameters and request content and parse the result.
+This sample shows how to call ImportAsync with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -1393,9 +2162,6 @@ using RequestContent content = RequestContent.Create(new
{
new
{
- sourceDisplayName = "",
- lastUpdatedDateTime = "2022-05-10T18:57:31.2311892Z",
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -1417,7 +2183,6 @@ using RequestContent content = RequestContent.Create(new
qnaId = 1234,
qna = new
{
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -1453,59 +2218,32 @@ using RequestContent content = RequestContent.Create(new
{
null
},
+ lastUpdatedDateTime = "2022-05-10T18:57:31.2311892Z",
+ sourceDisplayName = "",
}
},
},
fileUri = "",
});
-Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: "json", assetKind: "qnas");
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = await client.ImportAsync(WaitUntil.Completed, "", content, format: "json", assetKind: "qnas");
]]>
-This sample shows how to call Import and parse the result.
+This sample shows how to call Import.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = null;
-Operation operation = client.Import(WaitUntil.Completed, "", content);
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = client.Import(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call Import with all parameters and request content and parse the result.
+This sample shows how to call Import with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new
{
@@ -1535,9 +2273,6 @@ using RequestContent content = RequestContent.Create(new
{
new
{
- sourceDisplayName = "",
- lastUpdatedDateTime = "2022-05-10T18:57:31.2311892Z",
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -1559,7 +2294,6 @@ using RequestContent content = RequestContent.Create(new
qnaId = 1234,
qna = new
{
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -1595,99 +2329,61 @@ using RequestContent content = RequestContent.Create(new
{
null
},
+ lastUpdatedDateTime = "2022-05-10T18:57:31.2311892Z",
+ sourceDisplayName = "",
}
},
},
fileUri = "",
});
-Operation operation = client.Import(WaitUntil.Completed, "", content, format: "json", assetKind: "qnas");
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("details")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("code").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("message").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("details").GetProperty("").ToString());
-Console.WriteLine(result.GetProperty("errors")[0].GetProperty("innererror").GetProperty("target").ToString());
-Console.WriteLine(result.GetProperty("createdDateTime").ToString());
-Console.WriteLine(result.GetProperty("expirationDateTime").ToString());
-Console.WriteLine(result.GetProperty("jobId").ToString());
-Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
-Console.WriteLine(result.GetProperty("status").ToString());
+Operation operation = client.Import(WaitUntil.Completed, "", content, format: "json", assetKind: "qnas");
]]>
-This sample shows how to call DeployProjectAsync and parse the result.
+This sample shows how to call DeployProjectAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "");
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.ToString());
+Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "");
]]>
-This sample shows how to call DeployProjectAsync with all parameters and parse the result.
+This sample shows how to call DeployProjectAsync with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("deploymentName").ToString());
-Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
+Operation operation = await client.DeployProjectAsync(WaitUntil.Completed, "", "");
]]>
-This sample shows how to call DeployProject and parse the result.
+This sample shows how to call DeployProject.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
-
-Operation operation = client.DeployProject(WaitUntil.Completed, "", "");
-BinaryData responseData = operation.Value;
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.ToString());
+Operation operation = client.DeployProject(WaitUntil.Completed, "", "");
]]>
-This sample shows how to call DeployProject with all parameters and parse the result.
+This sample shows how to call DeployProject with all parameters.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
-Operation operation = client.DeployProject(WaitUntil.Completed, "", "");
-BinaryData responseData = operation.Value;
-
-JsonElement result = JsonDocument.Parse(responseData.ToStream()).RootElement;
-Console.WriteLine(result.GetProperty("deploymentName").ToString());
-Console.WriteLine(result.GetProperty("lastDeployedDateTime").ToString());
+Operation operation = client.DeployProject(WaitUntil.Completed, "", "");
]]>
-This sample shows how to call UpdateSourcesAsync and parse the result.
+This sample shows how to call UpdateSourcesAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1696,25 +2392,19 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
+ source = "",
sourceUri = "http://localhost:3000",
sourceKind = "file",
},
}
});
-Operation> operation = await client.UpdateSourcesAsync(WaitUntil.Completed, "", content);
-AsyncPageable responseData = operation.Value;
-await foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("sourceUri").ToString());
- Console.WriteLine(result.GetProperty("sourceKind").ToString());
-}
+Operation operation = await client.UpdateSourcesAsync(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateSourcesAsync with all parameters and request content and parse the result.
+This sample shows how to call UpdateSourcesAsync with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1723,36 +2413,25 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
- refresh = true,
displayName = "",
source = "",
sourceUri = "http://localhost:3000",
sourceKind = "file",
contentStructureKind = "unstructured",
+ refresh = true,
},
}
});
-Operation> operation = await client.UpdateSourcesAsync(WaitUntil.Completed, "", content);
-AsyncPageable responseData = operation.Value;
-await foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
- Console.WriteLine(result.GetProperty("displayName").ToString());
- Console.WriteLine(result.GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("sourceUri").ToString());
- Console.WriteLine(result.GetProperty("sourceKind").ToString());
- Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
-}
+Operation operation = await client.UpdateSourcesAsync(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateSources and parse the result.
+This sample shows how to call UpdateSources.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1761,25 +2440,19 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
+ source = "",
sourceUri = "http://localhost:3000",
sourceKind = "file",
},
}
});
-Operation> operation = client.UpdateSources(WaitUntil.Completed, "", content);
-Pageable responseData = operation.Value;
-foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("sourceUri").ToString());
- Console.WriteLine(result.GetProperty("sourceKind").ToString());
-}
+Operation operation = client.UpdateSources(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateSources with all parameters and request content and parse the result.
+This sample shows how to call UpdateSources with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1788,36 +2461,25 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
- refresh = true,
displayName = "",
source = "",
sourceUri = "http://localhost:3000",
sourceKind = "file",
contentStructureKind = "unstructured",
+ refresh = true,
},
}
});
-Operation> operation = client.UpdateSources(WaitUntil.Completed, "", content);
-Pageable responseData = operation.Value;
-foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
- Console.WriteLine(result.GetProperty("displayName").ToString());
- Console.WriteLine(result.GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("sourceUri").ToString());
- Console.WriteLine(result.GetProperty("sourceKind").ToString());
- Console.WriteLine(result.GetProperty("contentStructureKind").ToString());
-}
+Operation operation = client.UpdateSources(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateQnasAsync and parse the result.
+This sample shows how to call UpdateQnasAsync.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1827,19 +2489,13 @@ using RequestContent content = RequestContent.Create(new object[]
value = new object(),
}
});
-Operation> operation = await client.UpdateQnasAsync(WaitUntil.Completed, "", content);
-AsyncPageable responseData = operation.Value;
-await foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
-}
+Operation operation = await client.UpdateQnasAsync(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateQnasAsync with all parameters and request content and parse the result.
+This sample shows how to call UpdateQnasAsync with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1848,7 +2504,6 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -1891,44 +2546,16 @@ using RequestContent content = RequestContent.Create(new object[]
},
}
});
-Operation> operation = await client.UpdateQnasAsync(WaitUntil.Completed, "", content);
-AsyncPageable responseData = operation.Value;
-await foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
- Console.WriteLine(result.GetProperty("id").ToString());
- Console.WriteLine(result.GetProperty("answer").ToString());
- Console.WriteLine(result.GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("questions")[0].ToString());
- Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
-}
+Operation operation = await client.UpdateQnasAsync(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateQnas and parse the result.
+This sample shows how to call UpdateQnas.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1938,19 +2565,13 @@ using RequestContent content = RequestContent.Create(new object[]
value = new object(),
}
});
-Operation> operation = client.UpdateQnas(WaitUntil.Completed, "", content);
-Pageable responseData = operation.Value;
-foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.ToString());
-}
+Operation operation = client.UpdateQnas(WaitUntil.Completed, "", content);
]]>
-This sample shows how to call UpdateQnas with all parameters and request content and parse the result.
+This sample shows how to call UpdateQnas with all parameters and request content.
");
AzureKeyCredential credential = new AzureKeyCredential("");
-QuestionAnsweringAuthoringClient client = new QuestionAnsweringAuthoringClient(endpoint, credential);
+QuestionAnsweringProjects client = new AuthoringClient(endpoint, credential).GetQuestionAnsweringProjectsClient(apiVersion: "2023-04-01");
using RequestContent content = RequestContent.Create(new object[]
{
@@ -1959,7 +2580,6 @@ using RequestContent content = RequestContent.Create(new object[]
op = "add",
value = new
{
- id = 1234,
answer = "",
source = "",
questions = new object[]
@@ -2002,35 +2622,7 @@ using RequestContent content = RequestContent.Create(new object[]
},
}
});
-Operation> operation = client.UpdateQnas(WaitUntil.Completed, "", content);
-Pageable responseData = operation.Value;
-foreach (BinaryData item in operation.Value)
-{
- JsonElement result = JsonDocument.Parse(item.ToStream()).RootElement;
- Console.WriteLine(result.GetProperty("lastUpdatedDateTime").ToString());
- Console.WriteLine(result.GetProperty("id").ToString());
- Console.WriteLine(result.GetProperty("answer").ToString());
- Console.WriteLine(result.GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("questions")[0].ToString());
- Console.WriteLine(result.GetProperty("metadata").GetProperty("").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("isContextOnly").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayOrder").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qnaId").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("id").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("answer").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("source").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("questions")[0].ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("metadata").GetProperty("").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("qna").GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("dialog").GetProperty("prompts")[0].GetProperty("displayText").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("clusterHead").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("question").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("userSuggestedCount").ToString());
- Console.WriteLine(result.GetProperty("activeLearningSuggestions")[0].GetProperty("suggestedQuestions")[0].GetProperty("autoSuggestedCount").ToString());
-}
+Operation operation = client.UpdateQnas(WaitUntil.Completed, "", content);
]]>
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.Serialization.cs
new file mode 100644
index 000000000000..c9dd3b3b1102
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.Serialization.cs
@@ -0,0 +1,207 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class Error : 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(Error)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("code"u8);
+ writer.WriteStringValue(Code.ToString());
+ writer.WritePropertyName("message"u8);
+ writer.WriteStringValue(Message);
+ if (Optional.IsDefined(Target))
+ {
+ writer.WritePropertyName("target"u8);
+ writer.WriteStringValue(Target);
+ }
+ if (Optional.IsCollectionDefined(Details))
+ {
+ writer.WritePropertyName("details"u8);
+ writer.WriteStartArray();
+ foreach (var item in Details)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsDefined(Innererror))
+ {
+ writer.WritePropertyName("innererror"u8);
+ writer.WriteObjectValue(Innererror, 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
+ }
+ }
+ }
+
+ Error 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(Error)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeError(document.RootElement, options);
+ }
+
+ internal static Error DeserializeError(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ ErrorCode code = default;
+ string message = default;
+ string target = default;
+ IReadOnlyList details = default;
+ InnerErrorModel innererror = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("code"u8))
+ {
+ code = new ErrorCode(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("message"u8))
+ {
+ message = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("target"u8))
+ {
+ target = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("details"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(DeserializeError(item, options));
+ }
+ details = array;
+ continue;
+ }
+ if (property.NameEquals("innererror"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ innererror = InnerErrorModel.DeserializeInnerErrorModel(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new Error(
+ code,
+ message,
+ target,
+ details ?? new ChangeTrackingList(),
+ innererror,
+ 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(Error)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ Error 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 DeserializeError(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(Error)} 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 Error FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeError(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.cs
new file mode 100644
index 000000000000..2d6be6506aef
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Error.cs
@@ -0,0 +1,100 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ /// The error object.
+ public partial class Error
+ {
+ ///
+ /// 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 .
+ /// One of a server-defined set of error codes.
+ /// A human-readable representation of the error.
+ /// is null.
+ internal Error(ErrorCode code, string message)
+ {
+ Argument.AssertNotNull(message, nameof(message));
+
+ Code = code;
+ Message = message;
+ Details = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// One of a server-defined set of error codes.
+ /// A human-readable representation of the error.
+ /// The target of the error.
+ /// An array of details about specific errors that led to this reported error.
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal Error(ErrorCode code, string message, string target, IReadOnlyList details, InnerErrorModel innererror, IDictionary serializedAdditionalRawData)
+ {
+ Code = code;
+ Message = message;
+ Target = target;
+ Details = details;
+ Innererror = innererror;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal Error()
+ {
+ }
+
+ /// One of a server-defined set of error codes.
+ public ErrorCode Code { get; }
+ /// A human-readable representation of the error.
+ public string Message { get; }
+ /// The target of the error.
+ public string Target { get; }
+ /// An array of details about specific errors that led to this reported error.
+ public IReadOnlyList Details { get; }
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ public InnerErrorModel Innererror { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/ErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ErrorCode.cs
similarity index 71%
rename from sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/ErrorCode.cs
rename to sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ErrorCode.cs
index 60c5c9dee9c9..229533dfd1d0 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/ErrorCode.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ErrorCode.cs
@@ -8,10 +8,10 @@
using System;
using System.ComponentModel;
-namespace Azure.AI.Language.QuestionAnswering
+namespace Azure.AI.Language.QuestionAnswering.Authoring
{
/// Human-readable error code.
- internal readonly partial struct ErrorCode : IEquatable
+ public readonly partial struct ErrorCode : IEquatable
{
private readonly string _value;
@@ -36,35 +36,47 @@ public ErrorCode(string value)
private const string AzureCognitiveSearchIndexLimitReachedValue = "AzureCognitiveSearchIndexLimitReached";
private const string InternalServerErrorValue = "InternalServerError";
private const string ServiceUnavailableValue = "ServiceUnavailable";
+ private const string TimeoutValue = "Timeout";
+ private const string QuotaExceededValue = "QuotaExceeded";
+ private const string ConflictValue = "Conflict";
+ private const string WarningValue = "Warning";
- /// InvalidRequest.
+ /// Invalid request error.
public static ErrorCode InvalidRequest { get; } = new ErrorCode(InvalidRequestValue);
- /// InvalidArgument.
+ /// Invalid argument error.
public static ErrorCode InvalidArgument { get; } = new ErrorCode(InvalidArgumentValue);
- /// Unauthorized.
+ /// Unauthorized access error.
public static ErrorCode Unauthorized { get; } = new ErrorCode(UnauthorizedValue);
- /// Forbidden.
+ /// Forbidden access error.
public static ErrorCode Forbidden { get; } = new ErrorCode(ForbiddenValue);
- /// NotFound.
+ /// Not found error.
public static ErrorCode NotFound { get; } = new ErrorCode(NotFoundValue);
- /// ProjectNotFound.
+ /// Project not found error.
public static ErrorCode ProjectNotFound { get; } = new ErrorCode(ProjectNotFoundValue);
- /// OperationNotFound.
+ /// Operation not found error.
public static ErrorCode OperationNotFound { get; } = new ErrorCode(OperationNotFoundValue);
- /// AzureCognitiveSearchNotFound.
+ /// Azure Cognitive Search not found error.
public static ErrorCode AzureCognitiveSearchNotFound { get; } = new ErrorCode(AzureCognitiveSearchNotFoundValue);
- /// AzureCognitiveSearchIndexNotFound.
+ /// Azure Cognitive Search index not found error.
public static ErrorCode AzureCognitiveSearchIndexNotFound { get; } = new ErrorCode(AzureCognitiveSearchIndexNotFoundValue);
- /// TooManyRequests.
+ /// Too many requests error.
public static ErrorCode TooManyRequests { get; } = new ErrorCode(TooManyRequestsValue);
- /// AzureCognitiveSearchThrottling.
+ /// Azure Cognitive Search throttling error.
public static ErrorCode AzureCognitiveSearchThrottling { get; } = new ErrorCode(AzureCognitiveSearchThrottlingValue);
- /// AzureCognitiveSearchIndexLimitReached.
+ /// Azure Cognitive Search index limit reached error.
public static ErrorCode AzureCognitiveSearchIndexLimitReached { get; } = new ErrorCode(AzureCognitiveSearchIndexLimitReachedValue);
- /// InternalServerError.
+ /// Internal server error.
public static ErrorCode InternalServerError { get; } = new ErrorCode(InternalServerErrorValue);
- /// ServiceUnavailable.
+ /// Service unavailable error.
public static ErrorCode ServiceUnavailable { get; } = new ErrorCode(ServiceUnavailableValue);
+ /// Timeout error.
+ public static ErrorCode Timeout { get; } = new ErrorCode(TimeoutValue);
+ /// Quota exceeded error.
+ public static ErrorCode QuotaExceeded { get; } = new ErrorCode(QuotaExceededValue);
+ /// Conflict error.
+ public static ErrorCode Conflict { get; } = new ErrorCode(ConflictValue);
+ /// Warning error.
+ public static ErrorCode Warning { get; } = new ErrorCode(WarningValue);
/// Determines if two values are the same.
public static bool operator ==(ErrorCode left, ErrorCode right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.Serialization.cs
new file mode 100644
index 000000000000..d903851d9b37
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.Serialization.cs
@@ -0,0 +1,171 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class FeedbackRecord : 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(FeedbackRecord)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(UserId))
+ {
+ writer.WritePropertyName("userId"u8);
+ writer.WriteStringValue(UserId);
+ }
+ if (Optional.IsDefined(UserQuestion))
+ {
+ writer.WritePropertyName("userQuestion"u8);
+ writer.WriteStringValue(UserQuestion);
+ }
+ if (Optional.IsDefined(QnaId))
+ {
+ writer.WritePropertyName("qnaId"u8);
+ writer.WriteNumberValue(QnaId.Value);
+ }
+ if (options.Format != "W" && _serializedAdditionalRawData != null)
+ {
+ foreach (var item in _serializedAdditionalRawData)
+ {
+ writer.WritePropertyName(item.Key);
+#if NET6_0_OR_GREATER
+ writer.WriteRawValue(item.Value);
+#else
+ using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions))
+ {
+ JsonSerializer.Serialize(writer, document.RootElement);
+ }
+#endif
+ }
+ }
+ }
+
+ FeedbackRecord 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(FeedbackRecord)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeFeedbackRecord(document.RootElement, options);
+ }
+
+ internal static FeedbackRecord DeserializeFeedbackRecord(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ string userId = default;
+ string userQuestion = default;
+ int? qnaId = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("userId"u8))
+ {
+ userId = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("userQuestion"u8))
+ {
+ userQuestion = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("qnaId"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ qnaId = property.Value.GetInt32();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new FeedbackRecord(userId, userQuestion, qnaId, 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(FeedbackRecord)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ FeedbackRecord 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 DeserializeFeedbackRecord(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(FeedbackRecord)} 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 FeedbackRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeFeedbackRecord(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.cs
new file mode 100644
index 000000000000..93d657602ff8
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/FeedbackRecord.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.Language.QuestionAnswering.Authoring
+{
+ /// Feedback Record for Active Learning.
+ public partial class FeedbackRecord
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public FeedbackRecord()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Unique identifier of the user.
+ /// User suggested question for the QnA.
+ /// Unique ID of the QnA.
+ /// Keeps track of any properties unknown to the library.
+ internal FeedbackRecord(string userId, string userQuestion, int? qnaId, IDictionary serializedAdditionalRawData)
+ {
+ UserId = userId;
+ UserQuestion = userQuestion;
+ QnaId = qnaId;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Unique identifier of the user.
+ public string UserId { get; set; }
+ /// User suggested question for the QnA.
+ public string UserQuestion { get; set; }
+ /// Unique ID of the QnA.
+ public int? QnaId { get; set; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportExportFormat.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportExportFormat.cs
new file mode 100644
index 000000000000..15f73169bab3
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportExportFormat.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.Language.QuestionAnswering.Authoring
+{
+ /// Knowledge base Import or Export format.
+ public readonly partial struct ImportExportFormat : IEquatable
+ {
+ private readonly string _value;
+
+ /// Initializes a new instance of .
+ /// is null.
+ public ImportExportFormat(string value)
+ {
+ _value = value ?? throw new ArgumentNullException(nameof(value));
+ }
+
+ private const string JsonValue = "json";
+ private const string TsvValue = "tsv";
+ private const string ExcelValue = "excel";
+
+ /// Export or Import QnA assets in JSON format.
+ public static ImportExportFormat Json { get; } = new ImportExportFormat(JsonValue);
+ ///
+ /// Export or Import knowledge base replica including all assets and metadata in
+ /// Excel format.
+ ///
+ public static ImportExportFormat Tsv { get; } = new ImportExportFormat(TsvValue);
+ ///
+ /// Export or Import knowledge base replica including all assets and metadata in
+ /// Tsv format.
+ ///
+ public static ImportExportFormat Excel { get; } = new ImportExportFormat(ExcelValue);
+ /// Determines if two values are the same.
+ public static bool operator ==(ImportExportFormat left, ImportExportFormat right) => left.Equals(right);
+ /// Determines if two values are not the same.
+ public static bool operator !=(ImportExportFormat left, ImportExportFormat right) => !left.Equals(right);
+ /// Converts a to a .
+ public static implicit operator ImportExportFormat(string value) => new ImportExportFormat(value);
+
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public override bool Equals(object obj) => obj is ImportExportFormat other && Equals(other);
+ ///
+ public bool Equals(ImportExportFormat 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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.Serialization.cs
new file mode 100644
index 000000000000..4be299141745
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.Serialization.cs
@@ -0,0 +1,175 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.ClientModel.Primitives;
+using System.Collections.Generic;
+using System.Text.Json;
+using Azure.Core;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ public partial class ImportJobOptions : 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(ImportJobOptions)} does not support writing '{format}' format.");
+ }
+
+ if (Optional.IsDefined(Metadata))
+ {
+ writer.WritePropertyName("metadata"u8);
+ writer.WriteObjectValue(Metadata, options);
+ }
+ if (Optional.IsDefined(Assets))
+ {
+ writer.WritePropertyName("assets"u8);
+ writer.WriteObjectValue(Assets, options);
+ }
+ if (Optional.IsDefined(FileUri))
+ {
+ writer.WritePropertyName("fileUri"u8);
+ writer.WriteStringValue(FileUri);
+ }
+ 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
+ }
+ }
+ }
+
+ ImportJobOptions 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(ImportJobOptions)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeImportJobOptions(document.RootElement, options);
+ }
+
+ internal static ImportJobOptions DeserializeImportJobOptions(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ CreateProjectOptions metadata = default;
+ Assets assets = default;
+ string fileUri = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("metadata"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ metadata = CreateProjectOptions.DeserializeCreateProjectOptions(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("assets"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ assets = Assets.DeserializeAssets(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("fileUri"u8))
+ {
+ fileUri = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ImportJobOptions(metadata, assets, fileUri, 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(ImportJobOptions)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ImportJobOptions 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 DeserializeImportJobOptions(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ImportJobOptions)} 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 ImportJobOptions FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeImportJobOptions(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.cs
new file mode 100644
index 000000000000..418a71b11a35
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportJobOptions.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.Language.QuestionAnswering.Authoring
+{
+ /// Project assets the needs to be imported.
+ public partial class ImportJobOptions
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public ImportJobOptions()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// Parameters needed to create the project.
+ /// All assets for this project.
+ /// Import data File URI.
+ /// Keeps track of any properties unknown to the library.
+ internal ImportJobOptions(CreateProjectOptions metadata, Assets assets, string fileUri, IDictionary serializedAdditionalRawData)
+ {
+ Metadata = metadata;
+ Assets = assets;
+ FileUri = fileUri;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Parameters needed to create the project.
+ public CreateProjectOptions Metadata { get; set; }
+ /// All assets for this project.
+ public Assets Assets { get; set; }
+ /// Import data File URI.
+ public string FileUri { get; set; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.Serialization.cs
new file mode 100644
index 000000000000..89585c81dc1b
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.Serialization.cs
@@ -0,0 +1,294 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class ImportQnaRecord : 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(ImportQnaRecord)} does not support writing '{format}' format.");
+ }
+
+ if (options.Format != "W")
+ {
+ writer.WritePropertyName("id"u8);
+ writer.WriteNumberValue(Id);
+ }
+ if (Optional.IsDefined(Answer))
+ {
+ writer.WritePropertyName("answer"u8);
+ writer.WriteStringValue(Answer);
+ }
+ if (Optional.IsDefined(Source))
+ {
+ writer.WritePropertyName("source"u8);
+ writer.WriteStringValue(Source);
+ }
+ if (Optional.IsCollectionDefined(Questions))
+ {
+ writer.WritePropertyName("questions"u8);
+ writer.WriteStartArray();
+ foreach (var item in Questions)
+ {
+ writer.WriteStringValue(item);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsCollectionDefined(Metadata))
+ {
+ writer.WritePropertyName("metadata"u8);
+ writer.WriteStartObject();
+ foreach (var item in Metadata)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ if (Optional.IsDefined(Dialog))
+ {
+ writer.WritePropertyName("dialog"u8);
+ writer.WriteObjectValue(Dialog, options);
+ }
+ if (Optional.IsCollectionDefined(ActiveLearningSuggestions))
+ {
+ writer.WritePropertyName("activeLearningSuggestions"u8);
+ writer.WriteStartArray();
+ foreach (var item in ActiveLearningSuggestions)
+ {
+ writer.WriteObjectValue(item, options);
+ }
+ writer.WriteEndArray();
+ }
+ if (Optional.IsDefined(LastUpdatedDateTime))
+ {
+ writer.WritePropertyName("lastUpdatedDateTime"u8);
+ writer.WriteStringValue(LastUpdatedDateTime.Value, "O");
+ }
+ if (Optional.IsDefined(SourceDisplayName))
+ {
+ writer.WritePropertyName("sourceDisplayName"u8);
+ writer.WriteStringValue(SourceDisplayName);
+ }
+ 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
+ }
+ }
+ }
+
+ ImportQnaRecord 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(ImportQnaRecord)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeImportQnaRecord(document.RootElement, options);
+ }
+
+ internal static ImportQnaRecord DeserializeImportQnaRecord(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ int id = default;
+ string answer = default;
+ string source = default;
+ IList questions = default;
+ IDictionary metadata = default;
+ QnaDialog dialog = default;
+ IList activeLearningSuggestions = default;
+ DateTimeOffset? lastUpdatedDateTime = default;
+ string sourceDisplayName = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("id"u8))
+ {
+ id = property.Value.GetInt32();
+ continue;
+ }
+ if (property.NameEquals("answer"u8))
+ {
+ answer = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("source"u8))
+ {
+ source = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("questions"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(item.GetString());
+ }
+ questions = array;
+ continue;
+ }
+ if (property.NameEquals("metadata"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());
+ }
+ metadata = dictionary;
+ continue;
+ }
+ if (property.NameEquals("dialog"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ dialog = QnaDialog.DeserializeQnaDialog(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("activeLearningSuggestions"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ List array = new List();
+ foreach (var item in property.Value.EnumerateArray())
+ {
+ array.Add(SuggestedQuestionsCluster.DeserializeSuggestedQuestionsCluster(item, options));
+ }
+ activeLearningSuggestions = array;
+ continue;
+ }
+ if (property.NameEquals("lastUpdatedDateTime"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ lastUpdatedDateTime = property.Value.GetDateTimeOffset("O");
+ continue;
+ }
+ if (property.NameEquals("sourceDisplayName"u8))
+ {
+ sourceDisplayName = property.Value.GetString();
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new ImportQnaRecord(
+ id,
+ answer,
+ source,
+ questions ?? new ChangeTrackingList(),
+ metadata ?? new ChangeTrackingDictionary(),
+ dialog,
+ activeLearningSuggestions ?? new ChangeTrackingList(),
+ lastUpdatedDateTime,
+ sourceDisplayName,
+ 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(ImportQnaRecord)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ ImportQnaRecord 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 DeserializeImportQnaRecord(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(ImportQnaRecord)} 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 ImportQnaRecord FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeImportQnaRecord(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.cs
new file mode 100644
index 000000000000..0882ae0acfe4
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/ImportQnaRecord.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.Language.QuestionAnswering.Authoring
+{
+ /// Import QnA Record.
+ public partial class ImportQnaRecord
+ {
+ ///
+ /// Keeps track of any properties unknown to the library.
+ ///
+ /// To assign an object to the value of this property use .
+ ///
+ ///
+ /// To assign an already formatted json string to this property use .
+ ///
+ ///
+ /// Examples:
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson("foo")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromString("\"foo\"")
+ /// Creates a payload of "foo".
+ ///
+ /// -
+ /// BinaryData.FromObjectAsJson(new { key = "value" })
+ /// Creates a payload of { "key": "value" }.
+ ///
+ /// -
+ /// BinaryData.FromString("{\"key\": \"value\"}")
+ /// Creates a payload of { "key": "value" }.
+ ///
+ ///
+ ///
+ ///
+ private IDictionary _serializedAdditionalRawData;
+
+ /// Initializes a new instance of .
+ public ImportQnaRecord()
+ {
+ Questions = new ChangeTrackingList();
+ Metadata = new ChangeTrackingDictionary();
+ ActiveLearningSuggestions = new ChangeTrackingList();
+ }
+
+ /// Initializes a new instance of .
+ /// Unique ID for the QnA.
+ /// Answer text.
+ ///
+ /// Source from which QnA was indexed e.g.
+ /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
+ ///
+ /// List of questions associated with the answer.
+ ///
+ /// Metadata associated with the answer, useful to categorize or filter question
+ /// answers.
+ ///
+ /// Context of a QnA.
+ /// List of Active Learning suggestions for the QnA.
+ /// Date-time when the QnA was last updated.
+ /// Friendly name of the Source.
+ /// Keeps track of any properties unknown to the library.
+ internal ImportQnaRecord(int id, string answer, string source, IList questions, IDictionary metadata, QnaDialog dialog, IList activeLearningSuggestions, DateTimeOffset? lastUpdatedDateTime, string sourceDisplayName, IDictionary serializedAdditionalRawData)
+ {
+ Id = id;
+ Answer = answer;
+ Source = source;
+ Questions = questions;
+ Metadata = metadata;
+ Dialog = dialog;
+ ActiveLearningSuggestions = activeLearningSuggestions;
+ LastUpdatedDateTime = lastUpdatedDateTime;
+ SourceDisplayName = sourceDisplayName;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Unique ID for the QnA.
+ public int Id { get; }
+ /// Answer text.
+ public string Answer { get; set; }
+ ///
+ /// Source from which QnA was indexed e.g.
+ /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs .
+ ///
+ public string Source { get; set; }
+ /// List of questions associated with the answer.
+ public IList Questions { get; }
+ ///
+ /// Metadata associated with the answer, useful to categorize or filter question
+ /// answers.
+ ///
+ public IDictionary Metadata { get; }
+ /// Context of a QnA.
+ public QnaDialog Dialog { get; set; }
+ /// List of Active Learning suggestions for the QnA.
+ public IList ActiveLearningSuggestions { get; }
+ /// Date-time when the QnA was last updated.
+ public DateTimeOffset? LastUpdatedDateTime { get; set; }
+ /// Friendly name of the Source.
+ public string SourceDisplayName { get; set; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/InnerErrorCode.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorCode.cs
similarity index 54%
rename from sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/InnerErrorCode.cs
rename to sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorCode.cs
index 1d841ca2a8e0..028a5d10a2f9 100644
--- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/Models/InnerErrorCode.cs
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorCode.cs
@@ -8,10 +8,10 @@
using System;
using System.ComponentModel;
-namespace Azure.AI.Language.QuestionAnswering
+namespace Azure.AI.Language.QuestionAnswering.Authoring
{
/// Human-readable error code.
- internal readonly partial struct InnerErrorCode : IEquatable
+ public readonly partial struct InnerErrorCode : IEquatable
{
private readonly string _value;
@@ -28,19 +28,43 @@ public InnerErrorCode(string value)
private const string AzureCognitiveSearchNotFoundValue = "AzureCognitiveSearchNotFound";
private const string AzureCognitiveSearchThrottlingValue = "AzureCognitiveSearchThrottling";
private const string ExtractionFailureValue = "ExtractionFailure";
+ private const string InvalidRequestBodyFormatValue = "InvalidRequestBodyFormat";
+ private const string EmptyRequestValue = "EmptyRequest";
+ private const string MissingInputDocumentsValue = "MissingInputDocuments";
+ private const string InvalidDocumentValue = "InvalidDocument";
+ private const string ModelVersionIncorrectValue = "ModelVersionIncorrect";
+ private const string InvalidDocumentBatchValue = "InvalidDocumentBatch";
+ private const string UnsupportedLanguageCodeValue = "UnsupportedLanguageCode";
+ private const string InvalidCountryHintValue = "InvalidCountryHint";
- /// InvalidRequest.
+ /// Invalid request error.
public static InnerErrorCode InvalidRequest { get; } = new InnerErrorCode(InvalidRequestValue);
- /// InvalidParameterValue.
+ /// Invalid parameter value error.
public static InnerErrorCode InvalidParameterValue { get; } = new InnerErrorCode(InvalidParameterValueValue);
- /// KnowledgeBaseNotFound.
+ /// Knowledge base not found error.
public static InnerErrorCode KnowledgeBaseNotFound { get; } = new InnerErrorCode(KnowledgeBaseNotFoundValue);
- /// AzureCognitiveSearchNotFound.
+ /// Azure Cognitive Search not found error.
public static InnerErrorCode AzureCognitiveSearchNotFound { get; } = new InnerErrorCode(AzureCognitiveSearchNotFoundValue);
- /// AzureCognitiveSearchThrottling.
+ /// Azure Cognitive Search throttling error.
public static InnerErrorCode AzureCognitiveSearchThrottling { get; } = new InnerErrorCode(AzureCognitiveSearchThrottlingValue);
- /// ExtractionFailure.
+ /// Extraction failure error.
public static InnerErrorCode ExtractionFailure { get; } = new InnerErrorCode(ExtractionFailureValue);
+ /// Invalid request body format error.
+ public static InnerErrorCode InvalidRequestBodyFormat { get; } = new InnerErrorCode(InvalidRequestBodyFormatValue);
+ /// Empty request error.
+ public static InnerErrorCode EmptyRequest { get; } = new InnerErrorCode(EmptyRequestValue);
+ /// Missing input documents error.
+ public static InnerErrorCode MissingInputDocuments { get; } = new InnerErrorCode(MissingInputDocumentsValue);
+ /// Invalid document error.
+ public static InnerErrorCode InvalidDocument { get; } = new InnerErrorCode(InvalidDocumentValue);
+ /// Model version incorrect error.
+ public static InnerErrorCode ModelVersionIncorrect { get; } = new InnerErrorCode(ModelVersionIncorrectValue);
+ /// Invalid document batch error.
+ public static InnerErrorCode InvalidDocumentBatch { get; } = new InnerErrorCode(InvalidDocumentBatchValue);
+ /// Unsupported language code error.
+ public static InnerErrorCode UnsupportedLanguageCode { get; } = new InnerErrorCode(UnsupportedLanguageCodeValue);
+ /// Invalid country hint error.
+ public static InnerErrorCode InvalidCountryHint { get; } = new InnerErrorCode(InvalidCountryHintValue);
/// Determines if two values are the same.
public static bool operator ==(InnerErrorCode left, InnerErrorCode right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.Serialization.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.Serialization.cs
new file mode 100644
index 000000000000..66f45ce475d8
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.Serialization.cs
@@ -0,0 +1,208 @@
+// 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.Language.QuestionAnswering.Authoring
+{
+ public partial class InnerErrorModel : 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(InnerErrorModel)} does not support writing '{format}' format.");
+ }
+
+ writer.WritePropertyName("code"u8);
+ writer.WriteStringValue(Code.ToString());
+ writer.WritePropertyName("message"u8);
+ writer.WriteStringValue(Message);
+ if (Optional.IsCollectionDefined(Details))
+ {
+ writer.WritePropertyName("details"u8);
+ writer.WriteStartObject();
+ foreach (var item in Details)
+ {
+ writer.WritePropertyName(item.Key);
+ writer.WriteStringValue(item.Value);
+ }
+ writer.WriteEndObject();
+ }
+ if (Optional.IsDefined(Target))
+ {
+ writer.WritePropertyName("target"u8);
+ writer.WriteStringValue(Target);
+ }
+ if (Optional.IsDefined(Innererror))
+ {
+ writer.WritePropertyName("innererror"u8);
+ writer.WriteObjectValue(Innererror, 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
+ }
+ }
+ }
+
+ InnerErrorModel 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(InnerErrorModel)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeInnerErrorModel(document.RootElement, options);
+ }
+
+ internal static InnerErrorModel DeserializeInnerErrorModel(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ InnerErrorCode code = default;
+ string message = default;
+ IReadOnlyDictionary details = default;
+ string target = default;
+ InnerErrorModel innererror = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("code"u8))
+ {
+ code = new InnerErrorCode(property.Value.GetString());
+ continue;
+ }
+ if (property.NameEquals("message"u8))
+ {
+ message = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("details"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());
+ }
+ details = dictionary;
+ continue;
+ }
+ if (property.NameEquals("target"u8))
+ {
+ target = property.Value.GetString();
+ continue;
+ }
+ if (property.NameEquals("innererror"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ innererror = DeserializeInnerErrorModel(property.Value, options);
+ continue;
+ }
+ if (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new InnerErrorModel(
+ code,
+ message,
+ details ?? new ChangeTrackingDictionary(),
+ target,
+ innererror,
+ 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(InnerErrorModel)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ InnerErrorModel 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 DeserializeInnerErrorModel(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(InnerErrorModel)} 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 InnerErrorModel FromResponse(Response response)
+ {
+ using var document = JsonDocument.Parse(response.Content, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeInnerErrorModel(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/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.cs
new file mode 100644
index 000000000000..0b97a22b2560
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/InnerErrorModel.cs
@@ -0,0 +1,104 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ ///
+ /// An object containing more specific information about the error. As per
+ /// Microsoft One API guidelines -
+ /// https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses.
+ ///
+ public partial class InnerErrorModel
+ {
+ ///
+ /// 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 .
+ /// One of a server-defined set of error codes.
+ /// Error message.
+ /// is null.
+ internal InnerErrorModel(InnerErrorCode code, string message)
+ {
+ Argument.AssertNotNull(message, nameof(message));
+
+ Code = code;
+ Message = message;
+ Details = new ChangeTrackingDictionary();
+ }
+
+ /// Initializes a new instance of .
+ /// One of a server-defined set of error codes.
+ /// Error message.
+ /// Error details.
+ /// Error target.
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal InnerErrorModel(InnerErrorCode code, string message, IReadOnlyDictionary details, string target, InnerErrorModel innererror, IDictionary serializedAdditionalRawData)
+ {
+ Code = code;
+ Message = message;
+ Details = details;
+ Target = target;
+ Innererror = innererror;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal InnerErrorModel()
+ {
+ }
+
+ /// One of a server-defined set of error codes.
+ public InnerErrorCode Code { get; }
+ /// Error message.
+ public string Message { get; }
+ /// Error details.
+ public IReadOnlyDictionary Details { get; }
+ /// Error target.
+ public string Target { get; }
+ ///
+ /// An object containing more specific information than the current object about
+ /// the error.
+ ///
+ public InnerErrorModel Innererror { get; }
+ }
+}
diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Internal/Argument.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Internal/Argument.cs
new file mode 100644
index 000000000000..f2bb6e6d3881
--- /dev/null
+++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering.Authoring/src/Generated/Internal/Argument.cs
@@ -0,0 +1,129 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Azure.AI.Language.QuestionAnswering.Authoring
+{
+ internal static class Argument
+ {
+ public static void AssertNotNull(T value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNull(T? value, string name)
+ where T : struct
+ {
+ if (!value.HasValue)
+ {
+ throw new ArgumentNullException(name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(IEnumerable value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value is ICollection collectionOfT && collectionOfT.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ if (value is ICollection collection && collection.Count == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ using IEnumerator e = value.GetEnumerator();
+ if (!e.MoveNext())
+ {
+ throw new ArgumentException("Value cannot be an empty collection.", name);
+ }
+ }
+
+ public static void AssertNotNullOrEmpty(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (value.Length == 0)
+ {
+ throw new ArgumentException("Value cannot be an empty string.", name);
+ }
+ }
+
+ public static void AssertNotNullOrWhiteSpace(string value, string name)
+ {
+ if (value is null)
+ {
+ throw new ArgumentNullException(name);
+ }
+ if (string.IsNullOrWhiteSpace(value))
+ {
+ throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name);
+ }
+ }
+
+ public static void AssertNotDefault(ref T value, string name)
+ where T : struct, IEquatable
+ {
+ if (value.Equals(default))
+ {
+ throw new ArgumentException("Value cannot be empty.", name);
+ }
+ }
+
+ public static void AssertInRange(T value, T minimum, T maximum, string name)
+ where T : notnull, IComparable
+ {
+ if (minimum.CompareTo(value) > 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed.");
+ }
+ if (maximum.CompareTo(value) < 0)
+ {
+ throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed.");
+ }
+ }
+
+ public static void AssertEnumDefined(Type enumType, object value, string name)
+ {
+ if (!Enum.IsDefined(enumType, value))
+ {
+ throw new ArgumentException($"Value not defined for {enumType.FullName}.", name);
+ }
+ }
+
+ public static T CheckNotNull