diff --git a/.vscode/cspell.json b/.vscode/cspell.json index a125431734f8..b2bcf9f40a42 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -115,7 +115,8 @@ "filename": "**/sdk/cognitivelanguage/**/*", "words": [ "apim", - "nigiri" + "nigiri", + "qnas" ] }, { diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs index c935c96e009a..a4ff20a0d8e0 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/api/Azure.AI.Language.QuestionAnswering.netstandard2.0.cs @@ -188,6 +188,57 @@ public TextDocument(string id, string text) { } public string Text { get { throw null; } } } } +namespace Azure.AI.Language.QuestionAnswering.Projects +{ + public partial class QuestionAnsweringProjectsClient + { + protected QuestionAnsweringProjectsClient() { } + public QuestionAnsweringProjectsClient(System.Uri endpoint, Azure.AzureKeyCredential credential, Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions options = null) { } + public virtual Azure.Core.Pipeline.HttpPipeline Pipeline { get { throw null; } } + public virtual Azure.Response AddFeedback(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task AddFeedbackAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response CreateProject(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task CreateProjectAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeleteProject(bool waitForCompletion, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeleteProjectAsync(bool waitForCompletion, string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation DeployProject(bool waitForCompletion, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> DeployProjectAsync(bool waitForCompletion, string projectName, string deploymentName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Export(bool waitForCompletion, string projectName, string format = null, string assetKind = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> ExportAsync(bool waitForCompletion, string projectName, string format = null, string assetKind = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetDeleteStatus(string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetDeleteStatusAsync(string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetDeployments(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetDeploymentsAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetDeployStatus(string projectName, string deploymentName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetDeployStatusAsync(string projectName, string deploymentName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetExportStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetExportStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetImportStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetImportStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetProjectDetails(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetProjectDetailsAsync(string projectName, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetProjects(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetProjectsAsync(int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetQnas(string projectName, string source = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetQnasAsync(string projectName, string source = null, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetSources(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetSourcesAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Pageable GetSynonyms(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.AsyncPageable GetSynonymsAsync(string projectName, int? top = default(int?), int? skip = default(int?), int? maxpagesize = default(int?), Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetUpdateQnasStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetUpdateQnasStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response GetUpdateSourcesStatus(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task GetUpdateSourcesStatusAsync(string projectName, string jobId, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation Import(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, string format = null, string assetKind = null, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> ImportAsync(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, string format = null, string assetKind = null, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UpdateQnas(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateQnasAsync(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Operation UpdateSources(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateSourcesAsync(bool waitForCompletion, string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual Azure.Response UpdateSynonyms(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + public virtual System.Threading.Tasks.Task UpdateSynonymsAsync(string projectName, Azure.Core.RequestContent content, Azure.RequestContext context = null) { throw null; } + } +} namespace Microsoft.Extensions.Azure { public static partial class QuestionAnsweringClientExtensions diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Azure.AI.Language.QuestionAnswering.csproj b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Azure.AI.Language.QuestionAnswering.csproj index 19b8a65da1f3..72237d9c2091 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Azure.AI.Language.QuestionAnswering.csproj +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Azure.AI.Language.QuestionAnswering.csproj @@ -1,4 +1,4 @@ - + This is the client library for the Question Answering service, a cloud-based Natural Language Processing (NLP) service that allows you to create a natural conversational layer over your data. It is used to find the most appropriate answer for any input from your custom knowledge base (KB) of information. Microsoft Azure.AI.Language.QuestionAnswering client library @@ -7,6 +7,7 @@ 1.0.0 Azure AI Language Question Answering QnA Maker $(RequiredTargetFrameworks) + $(DefineConstants);EXPERIMENTAL @@ -33,4 +34,9 @@ + + + + + diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringProjectsClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringProjectsClient.cs new file mode 100644 index 000000000000..ae130c934340 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringProjectsClient.cs @@ -0,0 +1,3381 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.AI.Language.QuestionAnswering; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.QuestionAnswering.Projects +{ + /// The QuestionAnsweringProjects service client. + public partial class QuestionAnsweringProjectsClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly ClientDiagnostics _clientDiagnostics; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of QuestionAnsweringProjectsClient for mocking. + protected QuestionAnsweringProjectsClient() + { + } + + /// Initializes a new instance of QuestionAnsweringProjectsClient. + /// 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 QuestionAnsweringProjectsClient(Uri endpoint, AzureKeyCredential credential, QuestionAnsweringClientOptions options = null) + { + if (endpoint == null) + { + throw new ArgumentNullException(nameof(endpoint)); + } + if (credential == null) + { + throw new ArgumentNullException(nameof(credential)); + } + options ??= new QuestionAnsweringClientOptions(); + + _clientDiagnostics = new ClientDiagnostics(options); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Get the requested project metadata. + /// The name of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetProjectDetailsAsync(string projectName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetProjectDetails"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDetailsRequest(projectName, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Get the requested project metadata. + /// The name of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetProjectDetails(string projectName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetProjectDetails"); + scope.Start(); + try + { + using HttpMessage message = CreateGetProjectDetailsRequest(projectName, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or update a project. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// description: string, + /// language: string (required), + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// } + /// } + /// + /// Schema for Response Body: + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task CreateProjectAsync(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Create or update a project. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// description: string, + /// language: string (required), + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// } + /// } + /// + /// Schema for Response Body: + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response CreateProject(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.CreateProject"); + scope.Start(); + try + { + using HttpMessage message = CreateCreateProjectRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of a Project delete job. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetDeleteStatusAsync(string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetDeleteStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeleteStatusRequest(jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of a Project delete job. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetDeleteStatus(string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetDeleteStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeleteStatusRequest(jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an Export job, once job completes, returns the project metadata, and assets. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// resultUrl: string, + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetExportStatusAsync(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an Export job, once job completes, returns the project metadata, and assets. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// resultUrl: string, + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetExportStatus(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetExportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetExportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an Import job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetImportStatusAsync(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of an Import job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetImportStatus(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetImportStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetImportStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of a Deploy job. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// , , or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetDeployStatusAsync(string projectName, string deploymentName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetDeployStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeployStatusRequest(projectName, deploymentName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of a Deploy job. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// , , or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetDeployStatus(string projectName, string deploymentName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetDeployStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetDeployStatusRequest(projectName, deploymentName, jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates all the synonyms of a project. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// value: [ + /// { + /// alterations: [string] (required) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task UpdateSynonymsAsync(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateSynonyms"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateSynonymsRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates all the synonyms of a project. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// value: [ + /// { + /// alterations: [string] (required) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response UpdateSynonyms(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateSynonyms"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateSynonymsRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of update sources job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetUpdateSourcesStatusAsync(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetUpdateSourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUpdateSourcesStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of update sources job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetUpdateSourcesStatus(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetUpdateSourcesStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUpdateSourcesStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of update QnAs job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task GetUpdateQnasStatusAsync(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetUpdateQnasStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUpdateQnasStatusRequest(projectName, jobId, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets the status of update QnAs job. + /// The name of the project to use. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Body: + /// { + /// createdDateTime: string (ISO 8601 Format), + /// expirationDateTime: string (ISO 8601 Format), + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling" | "partiallyCompleted", + /// errors: [ + /// { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response GetUpdateQnasStatus(string projectName, string jobId, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.GetUpdateQnasStatus"); + scope.Start(); + try + { + using HttpMessage message = CreateGetUpdateQnasStatusRequest(projectName, jobId, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Add Active Learning feedback. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// records: [ + /// { + /// userId: string, + /// userQuestion: string, + /// qnaId: number + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task AddFeedbackAsync(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.AddFeedback"); + scope.Start(); + try + { + using HttpMessage message = CreateAddFeedbackRequest(projectName, content, context); + return await _pipeline.ProcessMessageAsync(message, _clientDiagnostics, context).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Add Active Learning feedback. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// records: [ + /// { + /// userId: string, + /// userQuestion: string, + /// qnaId: number + /// } + /// ] + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Response AddFeedback(string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.AddFeedback"); + scope.Start(); + try + { + using HttpMessage message = CreateAddFeedbackRequest(projectName, content, context); + return _pipeline.ProcessMessage(message, _clientDiagnostics, context); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Gets all projects for a user. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual AsyncPageable GetProjectsAsync(int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetProjects"); + async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetProjectsRequest(top, skip, maxpagesize, context) + : CreateGetProjectsNextPageRequest(nextLink, top, skip, maxpagesize, context); + var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all projects for a user. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// projectName: string, + /// description: string, + /// language: string, + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// }, + /// createdDateTime: string (ISO 8601 Format), + /// lastModifiedDateTime: string (ISO 8601 Format), + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Pageable GetProjects(int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + return PageableHelpers.CreatePageable(CreateEnumerable, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetProjects"); + IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetProjectsRequest(top, skip, maxpagesize, context) + : CreateGetProjectsNextPageRequest(nextLink, top, skip, maxpagesize, context); + var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, context, "value", "nextLink"); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// List all deployments of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// deploymentName: string, + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual AsyncPageable GetDeploymentsAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetDeployments"); + async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetDeploymentsRequest(projectName, top, skip, maxpagesize, context) + : CreateGetDeploymentsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// List all deployments of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// deploymentName: string, + /// lastDeployedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Pageable GetDeployments(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreatePageable(CreateEnumerable, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetDeployments"); + IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetDeploymentsRequest(projectName, top, skip, maxpagesize, context) + : CreateGetDeploymentsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, context, "value", "nextLink"); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the synonyms of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// alterations: [string] + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual AsyncPageable GetSynonymsAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetSynonyms"); + async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetSynonymsRequest(projectName, top, skip, maxpagesize, context) + : CreateGetSynonymsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the synonyms of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// alterations: [string] + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Pageable GetSynonyms(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreatePageable(CreateEnumerable, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetSynonyms"); + IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetSynonymsRequest(projectName, top, skip, maxpagesize, context) + : CreateGetSynonymsNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, context, "value", "nextLink"); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the sources of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// displayName: string, + /// source: string, + /// sourceUri: string, + /// sourceKind: "file" | "url", + /// contentStructureKind: "unstructured", + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual AsyncPageable GetSourcesAsync(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetSources"); + async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetSourcesRequest(projectName, top, skip, maxpagesize, context) + : CreateGetSourcesNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the sources of a project. + /// The name of the project to use. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// displayName: string, + /// source: string, + /// sourceUri: string, + /// sourceKind: "file" | "url", + /// contentStructureKind: "unstructured", + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Pageable GetSources(string projectName, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreatePageable(CreateEnumerable, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetSources"); + IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetSourcesRequest(projectName, top, skip, maxpagesize, context) + : CreateGetSourcesNextPageRequest(nextLink, projectName, top, skip, maxpagesize, context); + var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, context, "value", "nextLink"); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the QnAs of a project. + /// The name of the project to use. + /// Source of the QnA. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: QnaDialog, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// }, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [SuggestedQuestionsCluster], + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual AsyncPageable GetQnasAsync(string projectName, string source = null, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreateAsyncPageable(CreateEnumerableAsync, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetQnas"); + async IAsyncEnumerable> CreateEnumerableAsync(string nextLink, int? pageSizeHint, [EnumeratorCancellation] CancellationToken cancellationToken = default) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetQnasRequest(projectName, source, top, skip, maxpagesize, context) + : CreateGetQnasNextPageRequest(nextLink, projectName, source, top, skip, maxpagesize, context); + var page = await LowLevelPageableHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, context, "value", "nextLink", cancellationToken).ConfigureAwait(false); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Gets all the QnAs of a project. + /// The name of the project to use. + /// Source of the QnA. + /// The maximum number of resources to return from the collection. + /// An offset into the collection of the first resource to be returned. + /// The maximum number of resources to include in a single response. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Body: + /// { + /// value: [ + /// { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: QnaDialog, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// }, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [SuggestedQuestionsCluster], + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ], + /// nextLink: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Pageable GetQnas(string projectName, string source = null, int? top = null, int? skip = null, int? maxpagesize = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + if (projectName == null) + { + throw new ArgumentNullException(nameof(projectName)); + } + + return PageableHelpers.CreatePageable(CreateEnumerable, _clientDiagnostics, "QuestionAnsweringProjectsClient.GetQnas"); + IEnumerable> CreateEnumerable(string nextLink, int? pageSizeHint) + { + do + { + var message = string.IsNullOrEmpty(nextLink) + ? CreateGetQnasRequest(projectName, source, top, skip, maxpagesize, context) + : CreateGetQnasNextPageRequest(nextLink, projectName, source, top, skip, maxpagesize, context); + var page = LowLevelPageableHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, context, "value", "nextLink"); + nextLink = page.ContinuationToken; + yield return page; + } while (!string.IsNullOrEmpty(nextLink)); + } + } + + /// Delete the project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> DeleteProjectAsync(bool waitForCompletion, string projectName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.DeleteProject", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Delete the project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation DeleteProject(bool waitForCompletion, string projectName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.DeleteProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeleteProjectRequest(projectName, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.DeleteProject", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Export project metadata and assets. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". + /// Kind of the asset of the project. Allowed values: "qnas" | "synonyms". + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> ExportAsync(bool waitForCompletion, string projectName, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, format, assetKind, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.Export", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Export project metadata and assets. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". + /// Kind of the asset of the project. Allowed values: "qnas" | "synonyms". + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation Export(bool waitForCompletion, string projectName, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.Export"); + scope.Start(); + try + { + using HttpMessage message = CreateExportRequest(projectName, format, assetKind, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.Export", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Import project assets. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". + /// Kind of the asset of the project. Allowed values: "qnas" | "synonyms". + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Request Body: + /// { + /// metadata: { + /// description: string, + /// language: string (required), + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// } + /// }, + /// assets: { + /// synonyms: [ + /// { + /// alterations: [string] (required) + /// } + /// ], + /// qnas: [ + /// { + /// sourceDisplayName: string, + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: QnaDialog, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// }, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [SuggestedQuestionsCluster], + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ] + /// }, + /// fileUri: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> ImportAsync(bool waitForCompletion, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, assetKind, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.Import", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Import project assets. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// Knowledge base Import or Export format. Allowed values: "json" | "tsv" | "excel". + /// Kind of the asset of the project. Allowed values: "qnas" | "synonyms". + /// The request context, which can override default behaviors on the request on a per-call basis. + /// is null. + /// + /// Schema for Request Body: + /// { + /// metadata: { + /// description: string, + /// language: string (required), + /// multilingualResource: boolean, + /// settings: { + /// defaultAnswer: string + /// } + /// }, + /// assets: { + /// synonyms: [ + /// { + /// alterations: [string] (required) + /// } + /// ], + /// qnas: [ + /// { + /// sourceDisplayName: string, + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: QnaDialog, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// }, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [SuggestedQuestionsCluster], + /// lastUpdatedDateTime: string (ISO 8601 Format) + /// } + /// ] + /// }, + /// fileUri: string + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation Import(bool waitForCompletion, string projectName, RequestContent content, string format = null, string assetKind = null, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.Import"); + scope.Start(); + try + { + using HttpMessage message = CreateImportRequest(projectName, content, format, assetKind, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.Import", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deploy project to production. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> DeployProjectAsync(bool waitForCompletion, string projectName, string deploymentName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.DeployProject", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Deploy project to production. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The name of the specific deployment of the project to use. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation DeployProject(bool waitForCompletion, string projectName, string deploymentName, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.DeployProject"); + scope.Start(); + try + { + using HttpMessage message = CreateDeployProjectRequest(projectName, deploymentName, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.DeployProject", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates the sources of a project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// op: "add" | "delete" | "replace" (required), + /// value: { + /// displayName: string, + /// source: string, + /// sourceUri: string (required), + /// sourceKind: "file" | "url" (required), + /// contentStructureKind: "unstructured", + /// refresh: boolean + /// } (required) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> UpdateSourcesAsync(bool waitForCompletion, string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateSources"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateSourcesRequest(projectName, content, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.UpdateSources", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates the sources of a project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// op: "add" | "delete" | "replace" (required), + /// value: { + /// displayName: string, + /// source: string, + /// sourceUri: string (required), + /// sourceKind: "file" | "url" (required), + /// contentStructureKind: "unstructured", + /// refresh: boolean + /// } (required) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation UpdateSources(bool waitForCompletion, string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateSources"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateSourcesRequest(projectName, content, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.UpdateSources", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates the QnAs of a project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// op: "add" | "delete" | "replace" (required), + /// value: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: QnaRecord, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// } (required) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual async Task> UpdateQnasAsync(bool waitForCompletion, string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateQnas"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateQnasRequest(projectName, content, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.UpdateQnas", OperationFinalStateVia.Location, context, waitForCompletion).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Updates the QnAs of a project. + /// true if the method should wait to return until the long-running operation has completed on the service; false if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the project to use. + /// The content to send as the body of the request. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// or is null. + /// + /// Schema for Request Body: + /// { + /// op: "add" | "delete" | "replace" (required), + /// value: { + /// id: number, + /// answer: string, + /// source: string, + /// questions: [string], + /// metadata: Dictionary<string, string>, + /// dialog: { + /// isContextOnly: boolean, + /// prompts: [ + /// { + /// displayOrder: number, + /// qnaId: number, + /// qna: QnaRecord, + /// displayText: string + /// } + /// ] + /// }, + /// activeLearningSuggestions: [ + /// { + /// clusterHead: string, + /// suggestedQuestions: [ + /// { + /// question: string, + /// userSuggestedCount: number, + /// autoSuggestedCount: number + /// } + /// ] + /// } + /// ] + /// } (required) + /// } + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// +#pragma warning disable AZC0002 + public virtual Operation UpdateQnas(bool waitForCompletion, string projectName, RequestContent content, RequestContext context = null) +#pragma warning restore AZC0002 + { + using var scope = _clientDiagnostics.CreateScope("QuestionAnsweringProjectsClient.UpdateQnas"); + scope.Start(); + try + { + using HttpMessage message = CreateUpdateQnasRequest(projectName, content, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, _clientDiagnostics, "QuestionAnsweringProjectsClient.UpdateQnas", OperationFinalStateVia.Location, context, waitForCompletion); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateGetProjectsRequest(int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetProjectDetailsRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateCreateProjectRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier200201.Instance; + return message; + } + + internal HttpMessage CreateDeleteProjectRequest(string projectName, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetDeleteStatusRequest(string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/deletion-jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateExportRequest(string projectName, string format, string assetKind, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:export", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (format != null) + { + uri.AppendQuery("format", format, true); + } + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetExportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/export/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateImportRequest(string projectName, RequestContent content, string format, string assetKind, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/:import", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (format != null) + { + uri.AppendQuery("format", format, true); + } + if (assetKind != null) + { + uri.AppendQuery("assetKind", assetKind, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetImportStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/import/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateDeployProjectRequest(string projectName, string deploymentName, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetDeployStatusRequest(string projectName, string deploymentName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments/", false); + uri.AppendPath(deploymentName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetDeploymentsRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/deployments", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetSynonymsRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/synonyms", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateUpdateSynonymsRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/synonyms", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier204.Instance; + return message; + } + + internal HttpMessage CreateGetSourcesRequest(string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sources", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateUpdateSourcesRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetUpdateSourcesStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/sources/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetQnasRequest(string projectName, string source, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/qnas", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (source != null) + { + uri.AppendQuery("source", source, true); + } + if (top != null) + { + uri.AppendQuery("top", top.Value, true); + } + if (skip != null) + { + uri.AppendQuery("skip", skip.Value, true); + } + if (maxpagesize != null) + { + uri.AppendQuery("maxpagesize", maxpagesize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateUpdateQnasRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/qnas", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier202.Instance; + return message; + } + + internal HttpMessage CreateGetUpdateQnasStatusRequest(string projectName, string jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/qnas/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateAddFeedbackRequest(string projectName, RequestContent content, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/query-knowledgebases/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/feedback", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + request.Content = content; + message.ResponseClassifier = ResponseClassifier204.Instance; + return message; + } + + internal HttpMessage CreateGetProjectsNextPageRequest(string nextLink, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetDeploymentsNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetSynonymsNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetSourcesNextPageRequest(string nextLink, string projectName, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + internal HttpMessage CreateGetQnasNextPageRequest(string nextLink, string projectName, string source, int? top, int? skip, int? maxpagesize, RequestContext context) + { + var message = _pipeline.CreateMessage(context); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + message.ResponseClassifier = ResponseClassifier200.Instance; + return message; + } + + private sealed class ResponseClassifier200 : ResponseClassifier + { + private static ResponseClassifier _instance; + public static ResponseClassifier Instance => _instance ??= new ResponseClassifier200(); + public override bool IsErrorResponse(HttpMessage message) + { + return message.Response.Status switch + { + 200 => false, + _ => true + }; + } + } + private sealed class ResponseClassifier200201 : ResponseClassifier + { + private static ResponseClassifier _instance; + public static ResponseClassifier Instance => _instance ??= new ResponseClassifier200201(); + public override bool IsErrorResponse(HttpMessage message) + { + return message.Response.Status switch + { + 200 => false, + 201 => false, + _ => true + }; + } + } + private sealed class ResponseClassifier202 : ResponseClassifier + { + private static ResponseClassifier _instance; + public static ResponseClassifier Instance => _instance ??= new ResponseClassifier202(); + public override bool IsErrorResponse(HttpMessage message) + { + return message.Response.Status switch + { + 202 => false, + _ => true + }; + } + } + private sealed class ResponseClassifier204 : ResponseClassifier + { + private static ResponseClassifier _instance; + public static ResponseClassifier Instance => _instance ??= new ResponseClassifier204(); + public override bool IsErrorResponse(HttpMessage message) + { + return message.Response.Status switch + { + 204 => false, + _ => true + }; + } + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringRestClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringRestClient.cs index effde233a623..eba5a145af9a 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringRestClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/Generated/QuestionAnsweringRestClient.cs @@ -57,7 +57,7 @@ internal HttpMessage CreateGetAnswersRequest(string projectName, string deployme return message; } - /// Answers the specified question using your knowledge base. + /// Answers the specified question using your knowledge base. It is the runtime API for Custom Question Answering. /// The name of the project to use. /// The name of the specific deployment of the project to use. /// Post body of the request. @@ -94,7 +94,7 @@ public async Task> GetAnswersAsync(string projectName, s } } - /// Answers the specified question using your knowledge base. + /// Answers the specified question using your knowledge base. It is the runtime API for Custom Question Answering. /// The name of the project to use. /// The name of the specific deployment of the project to use. /// Post body of the request. @@ -150,7 +150,7 @@ internal HttpMessage CreateGetAnswersFromTextRequest(AnswersFromTextOptions text return message; } - /// Answers the specified question using the provided text in the body. + /// Answers the specified question using the provided text in the body. It is the runtime API for Prebuilt Question Answering. /// Post body of the request. /// The cancellation token to use. /// is null. @@ -177,7 +177,7 @@ public async Task> GetAnswersFromTextAsync(Answe } } - /// Answers the specified question using the provided text in the body. + /// Answers the specified question using the provided text in the body. It is the runtime API for Prebuilt Question Answering. /// Post body of the request. /// The cancellation token to use. /// is null. diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringProjectsClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringProjectsClient.cs new file mode 100644 index 000000000000..861ccdf8e05f --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/QuestionAnsweringProjectsClient.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Text; +using Azure.Core; + +[assembly: CodeGenSuppressType(nameof(Azure.AI.Language.QuestionAnswering.QuestionAnsweringClientOptions))] +namespace Azure.AI.Language.QuestionAnswering.Projects +{ + /// The QuestionAnsweringProjects service client. + [CodeGenType("QuestionAnsweringProjectsClient")] + public partial class QuestionAnsweringProjectsClient + { + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md index 57bf67a765de..9bf9ec678020 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.QuestionAnswering/src/autorest.md @@ -8,14 +8,15 @@ title: Question Answering license-header: MICROSOFT_MIT_NO_VERSION batch: -- input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/34a2c0723155d134311419fd997925ce96b85bec/specification/cognitiveservices/data-plane/Language/stable/2021-10-01/questionanswering.json +- input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2fe971edcf58b3351e6e5e67d269d4b4c7cc2c5f/specification/cognitiveservices/data-plane/Language/stable/2021-10-01/questionanswering.json clear-output-folder: true model-namespace: false # TODO: Uncomment when we ship authoring support and remove ./QuestionAnsweringClientOptions.cs. -# - input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/34a2c0723155d134311419fd997925ce96b85bec/specification/cognitiveservices/data-plane/Language/stable/2021-10-01/questionanswering-authoring.json -# add-credentials: true -# data-plane: true +- input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2fe971edcf58b3351e6e5e67d269d4b4c7cc2c5f/specification/cognitiveservices/data-plane/Language/stable/2021-10-01/questionanswering-authoring.json +# namespace: Azure.AI.Language.QuestionAnswering.Projects + add-credentials: true + data-plane: true modelerfour: lenient-model-deduplication: true @@ -47,6 +48,126 @@ directive: ]; ``` +### OperationId renames QuestionAnsweringAuthoring -> QuestionAnsweringProjects + +```yaml +directive: + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_ListProjects"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetProjectDetails"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}"]["patch"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_CreateProject"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}"]["delete"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_DeleteProject"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/deletion-jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetDeleteStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/:export"]["post"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_Export"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/export/jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetExportStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/:import"]["post"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_Import"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/import/jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetImportStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/deployments/{deploymentName}"]["put"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_DeployProject"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/deployments/{deploymentName}/jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetDeployStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/deployments"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_ListDeployments"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/synonyms"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetSynonyms"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/synonyms"]["put"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_UpdateSynonyms"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/sources"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetSources"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/sources"]["patch"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_UpdateSources"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/sources/jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetUpdateSourcesStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/qnas"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetQnas"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/qnas"]["patch"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_UpdateQnas"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/qnas/jobs/{jobId}"]["get"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_GetUpdateQnasStatus"; + + - from: swagger-document + where: $["paths"]["/query-knowledgebases/projects/{projectName}/feedback"]["post"] + transform: > + $["operationId"] = "QuestionAnsweringProjects_AddFeedback"; + + - from: swagger-document + where: $["paths"]["/:query-knowledgebases"]["post"] + transform: > + $["operationId"] = "QuestionAnswering_GetAnswers"; + + - from: swagger-document + where: $["paths"]["/:query-text"]["post"] + transform: > + $["operationId"] = "QuestionAnswering_GetAnswersFromText"; + +``` ### C# customizations ``` yaml diff --git a/sdk/cognitivelanguage/Azure.AI.Language.sln b/sdk/cognitivelanguage/Azure.AI.Language.sln index 9e31b8f10daf..b35f42abb7ef 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.sln +++ b/sdk/cognitivelanguage/Azure.AI.Language.sln @@ -4,6 +4,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 VisualStudioVersion = 17.0.31815.197 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.Language.QuestionAnswering", "Azure.AI.Language.QuestionAnswering\src\Azure.AI.Language.QuestionAnswering.csproj", "{9507A18C-F21A-4305-80B8-8E9DB4E5D351}" + ProjectSection(ProjectDependencies) = postProject + {8DAB9728-0F12-40DF-A5B7-EFD602AF3C0E} = {8DAB9728-0F12-40DF-A5B7-EFD602AF3C0E} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.AI.Language.QuestionAnswering.Tests", "Azure.AI.Language.QuestionAnswering\tests\Azure.AI.Language.QuestionAnswering.Tests.csproj", "{444BB90A-D67A-4590-9AC6-959256F727B0}" EndProject