From cbcd4c68a445517b8e4a20481bf6702f68b6a3a3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 24 May 2022 00:17:30 +0000 Subject: [PATCH] CodeGen from PR 19186 in Azure/azure-rest-api-specs Merge Cognitive Services - Language pillar version 2022-05-15-preview to main (#19186) * Updated May-1 preview to include changes from March-1 preview (#18580) * Updated May-1 preview to include changes from March-1 preview * Fixed a missed api version update in an example file Co-authored-by: Abigail Hartman * [Language API 2022-05-01-Preview]Conversation API Async - Conversational Summarization and Conversational PII (#17847) * Adds base for updating Language from version preview/2022-02-01-preview to version 2022-04-01-preview * Updates readme * Updates API version in new specs and examples * [Language API 2022-04-01-Preview] Feature conversation PII redaction and issue resolution summarization * Add Issue Resolution Summary * Address comments * address pretty chek and spell check issues * address file name mismatch issue * typo * Add IRD updates * Add IRD Schema changes * Response Files content update * Address feedback * Address PR comments * Address comments * Add the May API version * Address comments * Remove 04-01 and address comments * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-01-preview/common.json Co-authored-by: Heath Stewart * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-01-preview/common.json Co-authored-by: Heath Stewart * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-01-preview/analyzeconversations.json Co-authored-by: Heath Stewart * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-01-preview/analyzeconversations.json Co-authored-by: Heath Stewart * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-01-preview/textanalytics.json Co-authored-by: Heath Stewart * Address feedback V-1. * Address all comments expect model + enum descriptions * Fx validations * Missed files * Conversation Item modality issue * Update PII Task * Address Spec validation errors * Updates * Fix PII issues * Add readonly * Update schema * Updates * Bring back Text Conversation Item * Update example * Space in Json * Address comments * Address one more comments * Fix model validation * Fix * Update spec * Address comments * Move requestStatistics, prebuiltResult, error and warnings object to common * Address circular dependency Co-authored-by: Abigail Hartman Co-authored-by: Heath Stewart * Rename version from 2022-05-01-preview to 2022-05-15-preview (#18737) * Update CLU swagger (#18739) Co-authored-by: Chong Tang * Use azure-sdk-for-net-track2 for validation (#18755) * Bidishac/update field description (#18787) * Update the messaging on the parameter type * Update the documentation of the redactionSource field * Update specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/analyzeconversations.json Co-authored-by: Heath Stewart Co-authored-by: Chong Tang Co-authored-by: Heath Stewart * Unify the runtime and authoring APIs (#18837) * unifying single classification and multi classification to return array of class (#18902) * Renaming in 2022-05-15-preview (#18929) Co-authored-by: Chong Tang * Rename 'summary' in summaryAspects to 'issue' (#18941) * Rename 'summary' in summaryAspects to 'issue' * Merge issues * Update model version value * Merge 2022-05-01-GA authoring updates and "LUIS" string case update into 2022-05-15-preview branch (#18943) * Merge 2022-05-01-GA files changes into 2022-05-15-preview branch * Address Avocado issues and revert case update for Luis * Add the missing error codes * Fix avocado * Avocado fix * Add api-version parameter to cancel job endpoint (#18986) * Add api-version parameter to cancel job endpoint * Fix taskState and jobState * Revert "Fix taskState and jobState" This reverts commit 148dd2183249add89a090721db36a14c2b15d9bd. * Update LUIS to Luis in model names (#19012) * Copy QuestionAnswering definitions to common.json and refer them in analyzeconversations.json (#19031) Co-authored-by: Chong Tang * Added fhir feature updates to 2022-05-15-preview (#19092) Co-authored-by: Abigail Hartman * Add cancel endpoint for conversations (#19025) * Add cancel endpoint for conversations * Update examples path * Make the input for transcriptConversationItem optional * Bidishac/update enum name (#19149) * Update name to CreditCard * Update entity categories for PII for build * Keep SSN * Revert "Keep SSN" This reverts commit 77a92119ebd71cf5d5c7f201d402514756289ec2. * Update readme.md Co-authored-by: Abigail Hartman Co-authored-by: Abigail Hartman Co-authored-by: Bidisha Chakraborty <29803402+bidisha-c@users.noreply.github.com> Co-authored-by: Chong Tang Co-authored-by: Chong Tang Co-authored-by: Mohamed Abbas Co-authored-by: Nourhan <92883092+nourhaanfarid@users.noreply.github.com> --- .../Generated/AnalyzeConversationClient.cs | 162 ++++++++++++++++++ .../Generated/ConversationAnalysisClient.cs | 50 ++++-- .../ConversationAnalysisClientOptions.cs | 25 --- .../Generated/ConversationsClientOptions.cs | 37 ++++ .../src/autorest.md | 4 +- 5 files changed, 235 insertions(+), 43 deletions(-) create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/AnalyzeConversationClient.cs delete mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs create mode 100644 sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/AnalyzeConversationClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/AnalyzeConversationClient.cs new file mode 100644 index 0000000000000..1c05784284965 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/AnalyzeConversationClient.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.AI.Language.Conversations +{ + /// The AnalyzeConversation service client. + public partial class AnalyzeConversationClient + { + private const string AuthorizationHeader = "Ocp-Apim-Subscription-Key"; + private readonly AzureKeyCredential _keyCredential; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// The ClientDiagnostics is used to provide tracing support for the client library. + internal ClientDiagnostics ClientDiagnostics { get; } + + /// The HTTP pipeline for sending and receiving REST requests and responses. + public virtual HttpPipeline Pipeline => _pipeline; + + /// Initializes a new instance of AnalyzeConversationClient for mocking. + protected AnalyzeConversationClient() + { + } + + /// Initializes a new instance of AnalyzeConversationClient. + /// Supported Cognitive Services endpoint (e.g., https://<resource-name>.api.cognitiveservices.azure.com). + /// A credential used to authenticate to an Azure Service. + /// or is null. + public AnalyzeConversationClient(Uri endpoint, AzureKeyCredential credential) : this(endpoint, credential, new ConversationsClientOptions()) + { + } + + /// Initializes a new instance of AnalyzeConversationClient. + /// 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 AnalyzeConversationClient(Uri endpoint, AzureKeyCredential credential, ConversationsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ConversationsClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + + /// Cancel a long-running Text Analysis conversations job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure" | "InvalidRequestBodyFormat" | "EmptyRequest" | "MissingInputDocuments" | "InvalidDocument" | "ModelVersionIncorrect" | "InvalidDocumentBatch" | "UnsupportedLanguageCode" | "InvalidCountryHint", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// + public virtual async Task> CancelJobAsync(WaitUntil waitUntil, Guid jobId, RequestContext context = null) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationClient.CancelJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelJobRequest(jobId, context); + return await LowLevelOperationHelpers.ProcessMessageAsync(_pipeline, message, ClientDiagnostics, "AnalyzeConversationClient.CancelJob", OperationFinalStateVia.Location, context, waitUntil).ConfigureAwait(false); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// Cancel a long-running Text Analysis conversations job. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Job ID. + /// The request context, which can override default behaviors on the request on a per-call basis. + /// + /// Schema for Response Error: + /// { + /// error: { + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", + /// message: string, + /// target: string, + /// details: [Error], + /// innererror: { + /// code: "InvalidRequest" | "InvalidParameterValue" | "KnowledgeBaseNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchThrottling" | "ExtractionFailure" | "InvalidRequestBodyFormat" | "EmptyRequest" | "MissingInputDocuments" | "InvalidDocument" | "ModelVersionIncorrect" | "InvalidDocumentBatch" | "UnsupportedLanguageCode" | "InvalidCountryHint", + /// message: string, + /// details: Dictionary<string, string>, + /// target: string, + /// innererror: InnerErrorModel + /// } + /// } + /// } + /// + /// + /// + public virtual Operation CancelJob(WaitUntil waitUntil, Guid jobId, RequestContext context = null) + { + using var scope = ClientDiagnostics.CreateScope("AnalyzeConversationClient.CancelJob"); + scope.Start(); + try + { + using HttpMessage message = CreateCancelJobRequest(jobId, context); + return LowLevelOperationHelpers.ProcessMessage(_pipeline, message, ClientDiagnostics, "AnalyzeConversationClient.CancelJob", OperationFinalStateVia.Location, context, waitUntil); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + internal HttpMessage CreateCancelJobRequest(Guid jobId, RequestContext context) + { + var message = _pipeline.CreateMessage(context, ResponseClassifier202); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRaw("/language", false); + uri.AppendPath("/analyze-conversations/jobs/", false); + uri.AppendPath(jobId, true); + uri.AppendPath(":cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + private static ResponseClassifier _responseClassifier202; + private static ResponseClassifier ResponseClassifier202 => _responseClassifier202 ??= new StatusCodeClassifier(stackalloc ushort[] { 202 }); + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs index 8cd39678278e6..144bfd595060e 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClient.cs @@ -28,6 +28,24 @@ public partial class ConversationAnalysisClient /// The HTTP pipeline for sending and receiving REST requests and responses. public virtual HttpPipeline Pipeline => _pipeline; + /// Initializes a new instance of ConversationAnalysisClient. + /// 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 ConversationAnalysisClient(Uri endpoint, AzureKeyCredential credential, ConversationsClientOptions options) + { + Argument.AssertNotNull(endpoint, nameof(endpoint)); + Argument.AssertNotNull(credential, nameof(credential)); + options ??= new ConversationsClientOptions(); + + ClientDiagnostics = new ClientDiagnostics(options, true); + _keyCredential = credential; + _pipeline = HttpPipelineBuilder.Build(options, Array.Empty(), new HttpPipelinePolicy[] { new AzureKeyCredentialPolicy(_keyCredential, AuthorizationHeader) }, new ResponseClassifier()); + _endpoint = endpoint; + _apiVersion = options.Version; + } + /// Analyzes the input conversation utterance. /// 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. @@ -46,7 +64,7 @@ public partial class ConversationAnalysisClient /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -98,7 +116,7 @@ public virtual async Task AnalyzeConversationAsync(RequestContent cont /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -142,12 +160,12 @@ public virtual Response AnalyzeConversation(RequestContent content, RequestConte /// displayName: string, /// createdDateTime: string (ISO 8601 Format), /// expirationDateTime: string (ISO 8601 Format), - /// jobId: JobStateJobId, - /// lastUpdateDateTime: string (ISO 8601 Format), - /// status: JobState, + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "partiallyCompleted" | "failed" | "cancelled" | "cancelling", /// errors: [ /// { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -169,7 +187,7 @@ public virtual Response AnalyzeConversation(RequestContent content, RequestConte /// items: [ /// { /// lastUpdateDateTime: string (ISO 8601 Format), - /// status: TaskState, + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling", /// taskName: string, /// kind: "conversationalSummarizationResults" | "conversationalPIIResults" /// } @@ -186,7 +204,7 @@ public virtual Response AnalyzeConversation(RequestContent content, RequestConte /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -228,12 +246,12 @@ public virtual async Task JobStatusAsync(Guid jobId, bool? showStats = /// displayName: string, /// createdDateTime: string (ISO 8601 Format), /// expirationDateTime: string (ISO 8601 Format), - /// jobId: JobStateJobId, - /// lastUpdateDateTime: string (ISO 8601 Format), - /// status: JobState, + /// jobId: string, + /// lastUpdatedDateTime: string (ISO 8601 Format), + /// status: "notStarted" | "running" | "succeeded" | "partiallyCompleted" | "failed" | "cancelled" | "cancelling", /// errors: [ /// { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -255,7 +273,7 @@ public virtual async Task JobStatusAsync(Guid jobId, bool? showStats = /// items: [ /// { /// lastUpdateDateTime: string (ISO 8601 Format), - /// status: TaskState, + /// status: "notStarted" | "running" | "succeeded" | "failed" | "cancelled" | "cancelling", /// taskName: string, /// kind: "conversationalSummarizationResults" | "conversationalPIIResults" /// } @@ -272,7 +290,7 @@ public virtual async Task JobStatusAsync(Guid jobId, bool? showStats = /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -334,7 +352,7 @@ public virtual Response JobStatus(Guid jobId, bool? showStats = null, RequestCon /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], @@ -398,7 +416,7 @@ public virtual async Task> SubmitJobAsync(WaitUntil waitUn /// Schema for Response Error: /// { /// error: { - /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable", + /// code: "InvalidRequest" | "InvalidArgument" | "Unauthorized" | "Forbidden" | "NotFound" | "ProjectNotFound" | "OperationNotFound" | "AzureCognitiveSearchNotFound" | "AzureCognitiveSearchIndexNotFound" | "TooManyRequests" | "AzureCognitiveSearchThrottling" | "AzureCognitiveSearchIndexLimitReached" | "InternalServerError" | "ServiceUnavailable" | "Timeout" | "QuotaExceeded" | "Conflict" | "Warning", /// message: string, /// target: string, /// details: [Error], diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs deleted file mode 100644 index 8b25209f5105e..0000000000000 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationAnalysisClientOptions.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.AI.Language.Conversations -{ - /// Client options for ConversationAnalysisClient. - public partial class ConversationAnalysisClientOptions : ClientOptions - { - private const ServiceVersion LatestVersion = ServiceVersion.V2022_05_15_Preview; - - /// The version of the service to use. - public enum ServiceVersion - { - /// Service version "2022_05_15_Preview". - V2022_05_15_Preview = 1, - } - } -} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs new file mode 100644 index 0000000000000..ceac5cd8e6048 --- /dev/null +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/Generated/ConversationsClientOptions.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.AI.Language.Conversations +{ + /// Client options for Conversations library clients. + public partial class ConversationsClientOptions : ClientOptions + { + private const ServiceVersion LatestVersion = ServiceVersion.V2022_05_15_Preview; + + /// The version of the service to use. + public enum ServiceVersion + { + /// Service version "2022_05_15_Preview". + V2022_05_15_Preview = 1, + } + + internal string Version { get; } + + /// Initializes new instance of ConversationsClientOptions. + public ConversationsClientOptions(ServiceVersion version = LatestVersion) + { + Version = version switch + { + ServiceVersion.V2022_05_15_Preview => "2022_05_15_Preview", + _ => throw new NotSupportedException() + }; + } + } +} diff --git a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md index 3df741d2b5f0f..6f28087be0e99 100644 --- a/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md +++ b/sdk/cognitivelanguage/Azure.AI.Language.Conversations/src/autorest.md @@ -8,13 +8,13 @@ title: Conversations license-header: MICROSOFT_MIT_NO_VERSION batch: -- input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/6e137f0849ff79637544c773ad6da9e7bff3faf1/specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/analyzeconversations.json +- input-file: https://github.com/Azure/azure-rest-api-specs/blob/e7f37e4e43b1d12fd1988fda3ed39624c4b23303/specification/cognitiveservices/data-plane/Language/preview/2022-05-15-preview/analyzeconversations.json clear-output-folder: true model-namespace: false data-plane: true # TODO: Uncomment when we ship authoring support and remove ./ConversationsClientOptions.cs. -# - input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/33138867cd88a4a8689feb591a98dda26d96a63e/specification/cognitiveservices/data-plane/Language/preview/2021-07-15-preview/analyzeconversations-authoring.json +# - input-file: https://github.com/Azure/azure-rest-api-specs/blob/e7f37e4e43b1d12fd1988fda3ed39624c4b23303/specification/cognitiveservices/data-plane/Language/preview/2021-07-15-preview/analyzeconversations-authoring.json # add-credentials: true # data-plane: true